Display your current mood on your wordpress posts

February 1, 2009 · Print This Article

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.


Your choice for site templates and wordpress themes

Comments

Got something to say?

You must be logged in to post a comment.