• Hi there,

    I would like to use a template for all the posts in one of my categories. I have included the following in my single.php page before the loop. However it passes everything as true and therefore sends all the posts to the include regardless if it’s a post within the category 22 or not. Can you help?

    <?php if (in_category('22')) { ?>
    	<?php include(TEMPLATEPATH . '/includes/guided-tour.php'); ?>
    	<?php } else { ?>

    Thanks Jono

Viewing 1 replies (of 1 total)
  • as this is for a single post, you should be able to put this code within the loop without any problem, and that should solve your problem.

Viewing 1 replies (of 1 total)
  • The topic ‘Problem using in_category in single.php’ is closed to new replies.