using custom fields in WordPress


The key is the name for your custom variable, and the value is, well, it’s value! When you create a custom field, you are creating new meta-data. You then insert a simple line of php into your WordPress template where you want this extra data to appear in the theme and voila! You’re done.

<?php $values = get_post_custom_values("Subtitle"); echo $values[0]; ?>

or for thumbnails/images from a certain directory: (just add the image name.ext as the custom field value

<img src=”/blog/wp-content/uploads/<?php $values = get_post_custom_values(‘blog-image’); echo $values[0]; ?>” alt=”” />