In WordPress, one of the best ways to differentiate content is via the use of categories. In your theme, styling posts from different categories in unique ways will help visitors find what they want quickly and easily.
Decide where you want to check for a particular category. For this example, you'll be checking for the Featured
category and appending a little snippet of text. Insert your cursor inside of your Loop, and then add the following code:
<?php $category_name = 'Featured'; if(in_category($category_name)) { echo '<div class="featured-icon">Featured</div>'; } ?>
After you detect the special category and print the extra piece of content, you can style it however you want. In this particular case, you may want to use absolute positioning to add a star icon or badge to the post's main content container. Alternatively, you could add a large header that makes the post stand out. There is no limit to what...