Sometimes, we need to know what query vars are used in wordpress. In this tutorial, we will tell you how to list all of them.
The simpleset way is print global $wp_query in wordpress.
<?php global $wp_query; print_r($wp_query); ?>
Run this code, you will find a list query vars as follows:
WP_Query Object ( [query] => Array ( [pagename] => wordpress-theme ) [query_vars] => Array ( [pagename] => wordpress-theme [error] => [m] => [p] => 0 [post_parent] => [subpost] =>
You can find all query vars used in wordpress from query_vars and current query var used in current page.