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

Hey everyone, a simple question.


I need to add one more category: Events in the if statement along with News which is stated in the code. How can I add it? Thank You very much :)


<?php if (in_category('News')) : ?> 
share|improve this question
I forgot, I could do an array :) <?php if (in_category(array('News', 'Events'))) : ?> – jimilesku Mar 7 '12 at 16:15
If that was your answer, submit it and mark it as such. – mor7ifer Mar 7 '12 at 16:44
@m0r7if3r will do as soon as 8 hours passes as I don't have enough reputation points :( – jimilesku Mar 7 '12 at 17:37
up vote 0 down vote accepted

This is the answer :)

<?php if (in_category(array('News', 'Events'))) : ?>
share|improve this answer

Your Answer


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

Not the answer you're looking for? Browse other questions tagged or ask your own question.