This fixed it! 🙂 Hat-tip gmazzap for the useful info: Obliterate the main query and replace it
function wpse_286813_omit_all( $query_vars ){
// triggered also in admin pages
if ( is_admin() )
return $query_vars;
if( !empty($query_vars['taxo']) && $query_vars['taxo'] === 'all' ){
$query_vars['taxo']='';
}
return $query_vars;
}
add_filter( 'request', 'wpse_286813_omit_all' );
Related Posts:
- WP_Tax_Query with post_tag not working
- When to use WP_query(), query_posts() and pre_get_posts
- Should I use Pre Get Posts or WP_Query
- Nested meta_query with multiple relation keys
- Using pre_get_posts with WP_Query
- Multiple relationship for multiple tax_query in WP_Query
- WP_Query orderby post__in remains ineffective in the Loop [closed]
- WordPress tax_query “and” operator not functioning as desired
- What is “main query”? [duplicate]
- Conditional arguments for WP_Query and tax_query depending on if $somevar has a value
- Reduce or prevent calling of update_meta_cache
- How to add taxonomy filter on the query fly?
- Changing the meta_query of the main query based on custom query_vars and using pre_get_posts
- Escaping WP_Query tax_query when term has special character(s)
- Does tax_query really beats meta_query in all situations?
- How to uniquely identify queries?
- Order Search Results Page by meta_value If no Value Return Remaining Results
- Tax_query terms ID’s using variable
- pre_get_posts with get_posts
- How-to exclude terms from the main query the most performant way?
- Changing Posts Per Page and offset with pre_get_posts
- Slow SQL_CALC_FOUND_ROWS Query
- “pre_get_posts” firing on every query
- Why is my WP_Query not working when tax_query terms are an array?
- RSS feed with specific keyword
- Using is_main_query to select custom post type on certain page
- Multiple orderby parameters in pre_get_posts() action
- SQL Statement generated by WP_Query not producing expected results
- if wp_query taxonomy term have posts
- Sorting Posts by custom field
- How to pass custom parameter to WP_Query for filtering in pre_get_posts
- WooCommerce: filter by parent product’s taxonomy and product variation’s meta data
- Query with pre_get_posts to get pagination
- Recommended way to drop a pending query (in pre_get_posts)?
- Single page theme that uses pages for the content
- How to combine tax_query and date_query in WordPress
- Querying by taxonomy vs Querying by Custom fields Speed Comparison
- WordPress custom search form with pre_get_posts not work
- How to extend tag and category “Related Posts” query to custom post_type if the first 2 terms have no posts
- Using tax_query reverses my post_type argument in a custom WP_Query
- WP Query for Posts (Products) in Specific Category that has 2 Specific Tags (*AND* both tags not *OR*)
- If orderby parameter using pre_get_posts is the same for multiple posts what fallback does the query use?
- Can not switch the queried post in pre_get_posts hook
- Find all product that contain terms with %keywords% in WP_Query
- Get term by custom term meta and taxonomy
- How to target the default Recent Posts and Recent Comments widgets with pre_get_posts?
- order by multiple meta keys in pre_get_posts
- How to sort posts in admin by titles with dd.mm.yyyy format?
- tax_query shows no results if nothing is selected
- Splitting the main query in multiple loops with query_posts and/or pre_get_posts?
- get complex results set according to category structure
- How to Modify Taxonomy Archive Page with Search Parameter?
- Using pre_get_posts on a specific core/query block
- WP_Query tax_query problem
- How to add terms to my tax_query based off of the current post
- Searching through different categories on different pages code is not working
- How to display future posts – modified query still yields 404
- Query all posts in a given taxonomy
- Change default ordering of taxonomy terms – pre_get_terms
- tax_query OR with empty result returns all posts
- pre_get_posts filter meta_query without conflicting existing meta_query
- Including only current user’s posts in search
- When querying a combination of posts and other meta fields, is there a better solution than directly modifying the WHERE value?
- How to change posts order on Category and Tag archives?
- WP_Query, tax_query and term_meta: How to?
- Is it possible to dynamically get queried term AND taxonomy?
- Empty tax_query array returns an empty array
- How can i simulate “taxonomy__in” in query?
- Get list of terms that have posts in another term
- Formulate a url to show posts with both taxonomy terms
- My Main Query Modification is Messing up my dynamic main – why?
- Offset Page Loops and Pagination
- tax_query: Order by slug?
- pre_get_posts order by not working
- Adding a parameter to the default query
- Using WP_Query in “parse_query” or “pre_get_post” in Posts2Posts
- Single meta_query query using OR instead of AND in request’s WHERE statement
- How to choose between hooking into per_get_posts or into parse_query
- Meta Query relation “AND” not working
- Tax query clause inside a meta query clause?
- Nested tax_query that allows specified categories OR tags, but NOT other categories
- Store sticky post’s ids in a transient
- Querying on multiple taxonomies pulled from $_GET checkbox array not working?
- How to change main query based on post meta
- Populate tax_query terms parameter with post term
- new WP_Query to get max price meta value not working
- Display posts from only one post form in custom query and exclude in main query
- Show Sticky Post at the top but do not show again in the loop?
- WP_Query, pre_get_posts and offset
- Complex WP SQL Query
- Using meta_query with multiple keys and compare values
- Can I set my WP_Query to be a Main Query?
- Remove category from query (show all posts in archive.php) pre_get_posts()
- Fastest way of counting posts of a custom post type in a specific taxonomy term?
- Show scheduled posts in main loop but not in WP_Query?
- Fetch posts that match term slug first two letters (wp query)
- Is it a good idea to improve meta query performance by adding tax query?
- WP_Query | Tax_Query Relation | Unable to use ‘OR’ as it then allows all products, help me finish my query?
- WP_Query tax query part of slug
- Taxonomy Query Relation field not behaving correctly?