It is explained pretty thoroughly in the Codex, in my opinion. It serves a purpose e.g. when you want to grab posts for your taxonomy, it is a URL slug for your taxonomy, e.g. example.com/tag/cats
-> example.com/query_var/cats
.
Note: The query_var is used for direct queries through
WP_Query
like
new WP_Query( array( 'people' => $person_name ) )
and URL queries like
/?people=$person_name
. Settingquery_var
tofalse
will disable these methods, but you can still fetch posts with an explicitWP_Query
taxonomy query like
WP_Query(array('taxonomy'=>'people', 'term'=>$person_name)).
Basically, query_var
is part of the WordPress Query Vars.
Related Posts:
- Taxonomy Terms That Don’t Exist Display Results
- Using a custom WP_Query with get_template_part loop
- WP_Query orderby post__in remains ineffective in the Loop [closed]
- WP_QUERY Get posts by category and similar name (Like)
- Using get_posts vs. WP_Query
- Is it possible to wrap Geo Location search around WP_Query?
- How to Access Global $multipage or Global $numpages outside the loop?
- How can I use WP-CLI commands without –allow-root
- Merging a complex query with post_rewind and splitting posts into two columns
- Pagination Not working on Home Page with 2 Query
- WP_Query in a shortcode
- ‘posts_where’ filter not applying ‘WP_Query’ in `wp_ajax`
- Get all posts without tags
- Filter wp_query to search post title in function
- Two queries on the same page with pagination
- Sort by meta key on archive page
- Best approach to create Hot and Trending sections
- Retrieve or Query Pages by ID
- get complex results set according to category structure
- Searching through different categories on different pages code is not working
- Setup of taxonomy term template pages
- Ignore post by meta value in the main query
- Display posts in 3 days chunk
- how to get the id for a post from within a post and return post meta for it
- WP_Query’s “request” SQL Query
- How to make this WP_Query run faster on a WordPress website?
- Order taxonomy terms in alphabetical order
- is_search was called incorrectly
- Empty tax_query array returns an empty array
- How do I sort posts with multiple pages
- Sorting By Custom Posts With Attachments
- Attachment changing page’s permalink – $post not resetting?
- How to choose between hooking into per_get_posts or into parse_query
- Make (post) query a clickable link
- How to set pagination to work with ‘/page/’?
- How to do meta_query for attachments?
- How can I fix: “Notice: Undefined offset: 0”?
- Most commented last 24h, week, month, year and all time – posts_where
- WP_Query Pagination on multiple-loop page breaks WP or doesn’t show up
- How can I filter by slug depending on language selection
- Why isn’t my `meta_query` array functioning properly?
- How to duplicate 5 posts out of WP_Query results?
- WP_query sorting can’t sort danish letters (æ, ø, å)
- Dynamic User Id
- Slow queries on a huge database
- Multisite pagination issue by multi query archive 404
- get_post_meta slowing down my page load (in a plugin)
- “tax_query” parameter is ignored when “p” parameter is set in WP_Query
- Hide elements outside loop based on query
- How can i share WP_Query between multiple functions?
- sort and display posts by custom field (wp-query and the loop))
- I need help using pre_get_comments to limit comments in the comments admin screen
- WP_query only displays one of my custom post type entries
- Issues with search after added meta_query
- How to create dynamic value in WP_Query meta_query
- Woocommerce: order posts by meta key
- Modify query posts
- WP_Query with multiple orderby NOT working with ASC and DESC, what’s wrong?
- query post by author gender
- Display all attached image of every post of custom post type and link to original post
- How do I add an item to the WP admin menu?
- Multiple meta query from array
- Get Post ID as a separate RSS feed item
- how to retrieve WP_Query without ordering by date [duplicate]
- Which is from this queries is more faster
- Start Query from 2nd Post without offset
- Related posts by current posts child category
- Trying to change category of wp_query
- Any quicker alternative for WP_Query “NOT IN”
- duplicated posts when using pagination
- How to use the Term Object from a custom select field in a query
- meta_query order by date present -> future then show null
- How to upload 3 attachments to current post?
- In a WordPress multisite configuration, how do I instruct WP_Query() to return posts from a sub-site?
- How to query for exact string in custom field?
- Multi line of $wpdb->query just run 1 time and end the loop right after
- Sort posts on custom field AND after that sort on date?
- Get last child of given page by ID
- How to query users by post count no less than 10
- display the children of the post using the current page as the main parent
- Paginated Author.php not using Author.php template
- Help displaying related categories
- A very strange problem with search query
- In Product Category archives how to show Posts having same/similar prod_cat slug structure?
- Custom Theme Building & Permalinks
- wp_query – show pages that have parent defined
- previous_posts_link not working in WordPress pagination
- Eliminate typical pages on search page, turn it into ajax search with “infinite” sized single page
- WP Query to order posts by multiple meta fields
- Display First posts without the default featured image
- paginate_links() with Custom Taxonomy
- Parsing External Table Arguments
- query_posts, oderby meta_value & print “future” posts
- Query posts by meta value and sort by another meta key
- Output ACF field dynamicaly within a taxonomy loop [closed]
- Why does WP_Query not search for two ‘meta_query’ keys separated with OR?
- How do I split a large query with a semi-expensive function included into multiple smaller queries
- Custom WP_query in Jnews theme returns thousands of posts
- wp_query loop with compare operator simply not working, why?
- WP Query returning all posts when Meta_query is null