How to check if a post is in a specific category and perform a specific task depending on the category
There are many times when performing a special task, for example showing a special image or displaying different task based on a post category is needed. The below example is code being added to the single.php (posts) template. Make sure you add the example within the post loop: 1 <?php if (have_posts()) : while (have_posts()) [...]