Many WordPress users utilize categories to differentiate between different types of content or to show their intent with regard to a particular post. As a theme author, it is sometimes useful to differentiate between categories by using an image or special text. To do so, you must first determine if the user is viewing a post in a special category. Then you can take the appropriate action or render the appropriate output.
First, decide on the category that you wish to display special content for, and remember its name. Open a template file where you are displaying posts in a Loop and you wish to add special content for posts in a certain category. Place your cursor where you want to display special output, and then insert the following code:
<?php if(in_category('Category Name')) { // Output appropriate code here } ?>
Replace Category Name
with the name of the category that you wish to use.