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

I think it's great to use conditional tags but if the query is slightly advanced it won't give information about the original query. For example; is_category('apple') might give a false response if "banana" AND "apple" has been queried. This is because is_category() compares against one single category and doesn't bother about the rest.

I need a way to know when I can expect that conditional tags won't give complete information about the original query. Can someone explain the limits of wordpress conditional tags?

share|improve this question
There's an answer to this question and the correct answer would be useful for the wp community. – offroff Jul 22 '12 at 14:38
up vote 2 down vote accepted

is_category('apple') might give a false response if "banana" AND "apple" has been queried

you're using is_category incorrectly in this context. From Codex:

is_category(); // When any Category archive page is being displayed.

A category archive page is for a single term, if a query is a for more than one term, it's not a term archive page. so it's not a matter of "giving complete information" it's a matter of understanding what each tag actually indicates.

share|improve this answer
Yeah, I can't use is_category() in some situations and that's why I ask for a better understanding. Like many others I use conditional tags in actions and filters, not just in specific templates. I don't believe that's wrong. – offroff Jul 21 '12 at 14:47

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.