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 am trying to customize behavior for different displays of pages; I know I can use the Template Hierarchy and Conditional Tags to accomplish this. In the process of debugging, though, I'd like to be able to access all the meta-information about a page without having to iterate through all the is_* functions.

Is there a way to access this meta-information without rolling my own function (which would basically iterate through all the is_* functions). It would also be nice if this function had other information in it as well such as page-id, author, category, etc.

share|improve this question
up vote 2 down vote accepted

you can inspect $wp_query to see the query vars and returned data, including all of those conditionals:

<pre><?php print_r($wp_query); ?></pre>
share|improve this answer
Perfect! Thanks! – Avery Chan Jun 5 '11 at 4:07

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.