• The following code is pasted into a category-7.php template

    <?php if (is_category('7')) {
    echo 'test';
    }
    ?>
    
    <?php echo 'yes';?>

    I’m not managing to get the first bit of code to work, though the second displays ok.

    Is there anything obvious that I’m doing wrong?

Viewing 1 replies (of 1 total)
  • Hi richarduk. I’m no php expert but since it’s so difficult to get an answer on these forums, I’ll throw in my 2 cents. Your code snippet worked fine for me.

    You did make sure that you have a category that actually has a numerical id of “7”, correct?

Viewing 1 replies (of 1 total)

The topic ‘is_category conditional not working – my code?’ is closed to new replies.