Viewing 5 replies - 1 through 5 (of 5 total)
  • <?php if (is_page('13') && in_category('nba')) {?>
    
     Insert your code...
    
    <?php }?>
    Thread Starter jockpost

    (@jockpost)

    Sorry, but the code above didn’t work for me.

    I’m very close…

    The following code below is almost working. The problem is I can’t seem to get it to be the exact page.

    <?php if ( $paged > 12 && is_category('nba')) { ?>
    <p>Test</p>
    <?php } ?>

    This shows the code on all pages above Page 12. If I change the greater-than symbol to an equals sign, it stops working. How can I have it show up on one specific page in an archive (category)?

    Thread Starter jockpost

    (@jockpost)

    Believe it or not, this worked:

    <?php if ( $paged > 12 && is_category('nba') && $paged < 14 ) { ?>
    Text
    <?php } ?>

    Seems a little hokey to me…

    More than 12 and less than 14, lol, why not just check if it’s a value of 13?

    <?php if( 13 == $paged && is_category('nba') ) : ?>
    Text
    <?php endif; ?>

    LOL Mark beat me to it, but I wanted to keep the “hokey-ness” and bracket the options

    <?php if((( 13 == $paged || ($paged == 13 )) && (is_category('nba'))): ?>
    Text
    <?php endif; ?>

    ??

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘How To Display Code On A Specific Category Page’ is closed to new replies.