Custom Field Hacks For WordPress

Custom fields are a great little thing. They allow you to easily customize your blog with only a little bit of code. Below is a succinct explanation on how to do it, courtesy wprecipes.com

Open your single.php file (You can also modify your index.php file) and paste the following code anywhere within the loop:

$customField = get_post_custom_values("mood");
if (isset($customField[0])) {
echo "Mood: ".$customField[0];

Save the file. Now when you’ll write a new post, just create a custom field named mood and type your current mood as a value.

Leave a Reply