WordPress.org

Ready to get started?Download WordPress

Forums

Show some code based on category page (3 posts)

  1. mreider
    Member
    Posted 7 years ago #

    Hey all,

    I want to show some html on the first page of a particular categories archive.

    I've tried using
    <?php if ( in_category('3') ): ?>
    Hello
    <?php endif; ?>

    Which works, but as I said I only want the code to appear on the first page of that category archive.

    Any ideas how I can do this?

  2. mreider
    Member
    Posted 7 years ago #

    Got it - I just grabbed the URL and did an if statement. :)

  3. Spamboy
    Member
    Posted 7 years ago #

    Can you post the code you used? I'm trying to do something similar on my site (show certain code only on the first and last pages of a category archive). Thanks!

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags