WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top


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

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.