add_action('template_redirect', function () {
global $wp_query;
echo '<pre>';
print_r($wp_query);
echo '</pre>';
die;
});
1 Answer
For just print the query object put this in your function.php
:
add_action('wp_footer', function () {
global $wp_query;
echo '<pre>';
print_r($wp_query);
echo '</pre>';
die;
});