Show your Mood to Readers.

Do you want to show your mood to your readers on each post? If you want to do this just follow this article and learn how to show your mood with a custom field.

Firstly i want to ask you; Where want to show your mood, in single post or site index or both of them? If you want to show this in single post just modify your theme’s single.php, if you want to show this only in index, modify the your theme’s index.php or you want to show in both of this areas, modify index.php and single.php together.

Just Copy this code below and paste it in index.php or single.php‘s loop areas (After your article ord before article, where you want).

Here is the code;

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

Now Just create a customfield with named ‘mood‘ and add this custom field when you write an article.


Related posts:

If you enjoyed this post, make sure you subscribe to my RSS Feed
Comments are closed.
Highslide for Wordpress Plugin