Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.


Sorry for the vague title decription - Couldn't word it any different.

In my index.php page I have the following code:

<?php  if (is_category('6')) { ?>
<?php include (TEMPLATEPATH . '/blog.php'); ?>
<?php } else { ?>
<?php if ( is_front_page() ) {
      $paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
      query_posts("cat=5&paged=$paged");} ?>

Now, I'd like to include another category in the 'blog.php' template, but simply adding the cat number in the first line, like:

<?php  if (is_category('6, 7')) { ?>

is not working and simply ignores both.

Any idea of what I'm missing here, or perhaps a better way to do it altogether?


share|improve this question

1 Answer 1

You need to put it in an array.

<?php if(is_category(array(1,2,3,4)) ?>
share|improve this answer
Thanks, This works! It was just missing the left gullwing, as in: –  user2294 Jan 28 '11 at 2:38

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.