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.

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
add comment

1 Answer

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
add comment

Your Answer

 
discard

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.