Skip to content

Instantly share code, notes, and snippets.

@scribu
Created October 20, 2010 17:02
Show Gist options
  • Save scribu/636827 to your computer and use it in GitHub Desktop.
Save scribu/636827 to your computer and use it in GitHub Desktop.
WP_Query Debug
<?php
function wp_query_debug() {
global $wp, $wp_query;
echo '<pre>';
var_dump($wp->matched_rule);
print_r($wp_query);
echo '</pre>';
}
add_action('wp_head', 'wp_query_debug');
@scribu
Copy link
Author

scribu commented Oct 20, 2010

Paste the above code in a php file inside wp-content/mu-plugins and then visit the front page of your site.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment