When developing a WordPress theme or plugin, it may be very useful to be able to output all WP Query variables. Here is a simple code snippet to do it easily.
Paste the code below on any files, where you’d like to display the WP Query variables.
<?php
// display all wp query variables
global $wp_query;
var_dump( $wp_query->query_vars );
?>