Support » Fixing WordPress » Display DIV only if post is in most recent specific category

  • I want to display a DIV atop a post, but only if said post is the most recent in a specific category. In this case, the name of that category is “episodes”. Below is my code… what do I need to bolt onto my IF-statement to make this function properly?

    Thanks in advance!

    <?php if(in_category('episodes')){ ?>
    <div id="latest-ep" class="latest-ep">
    <p>Latest Episode</p>
    </div>
    <?php }?>
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Display DIV only if post is in most recent specific category’ is closed to new replies.