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
- Using pre_get_posts with WP_Query
- What is “main query”? [duplicate]
- Conditional arguments for WP_Query and tax_query depending on if $somevar has a value
- 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
- 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
- pre_get_posts with get_posts
- Changing Posts Per Page and offset with pre_get_posts
- “pre_get_posts” firing on every query
- RSS feed with specific keyword
- Multiple orderby parameters in pre_get_posts() action
- if wp_query taxonomy term have posts
- How to pass custom parameter to WP_Query for filtering in pre_get_posts
- Query with pre_get_posts to get pagination
- Single page theme that uses pages for the content
- 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
- Get term by custom term meta and taxonomy
- Using pre_get_posts on a specific core/query block
- tax_query OR with empty result returns all posts
- pre_get_posts filter meta_query without conflicting existing meta_query
- 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?
- 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
- Tax query clause inside a meta query clause?
- Querying on multiple taxonomies pulled from $_GET checkbox array not working?
- How to change main query based on post meta
- 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
- WP_Query, pre_get_posts and offset
- Complex WP SQL Query
- Taxonomy Query Relation field not behaving correctly?
- Filtering out child category posts from parent category archive not working
- Shouldn’t I be able to modify the main query by this filter?
- using pre_get_posts for search results not found
- Query with meta_query and tax_query together not working properly
- Adding a tax_query to a WP_Query Object
- Woocommerce – exclude only older out-of-stock items
- WP Query – order posts by meta field first and then order the rest
- Order or Orderby in tax_query (How to define order of terms in WP_Query)
- How I can change the condition or compare operator for WP_Query in pre_get_posts
- exclude product with available tag
- How to add tax_query to $args with concatenation
- WP_Query – How to get all posts of specific days of week by custom field date?
- Is it possible to add relation between meta_query and tax_query?
- Tax_Query using WP_Query not working
- tax_query in pre_get_posts
- $wp_query->found_posts not returning correct value
- Elementor posts custom query based on tag [closed]
- Exclude post with taxonomy and from the terms (taxonomy & tag) posts count
- `offset` WP_Query argument dont work via `pre_get_posts`
- Replace wp_query with wp_user_query
- Make a products only viewable to a specific user ID in meta_query pre_get_posts
- Facing problem with tax_query results
- pre_get_posts pagination not working
- meta_query is overriding default search
- order posts by a secondary query that counts items
- WordPress post_status and meta_query
- Woocomerce – Order products by float attribute in archive pages
- Order posts by title and custom field value?
- Tax_Query not working – connecting to second wordpress database
- Limit default Search query to post_title
- WordPress tax_query ignoring relation OR
- Optimal way to make tags in tax_query optional?
- in tax_query this Is the code correct? I need to access beginner video posts for different subject
- why doesn’t this pre_get_posts code work?
- pre_get_posts with WP_Query to prevent posts from specific tags
- display all posts from category with and without terms in chronological order
- Using the same WP_Query for shop and widgets in WooCommerce shop
- How can I get all the posts that are related with a specific taxonomy term?
- How to combine nested tax_query logic with other nested query logic?
- Custom taxonomy and query multi conditions
- tax_query not working for taxonomy slug
- Extending WP Query: Custom geolocation meta values work, but tax_query breaks
- Empty ‘terms’ in ‘tax_query’ returns an empty array
- WP_Query: Meta_Query with serialized value (or a workaround)
- Multiple tax_queries: display posts titles from several custom taxonomie
- Escaping WP_Query tax_query when term has special character(s)
- How to get hierarchical number of custom taxanomy
- Adding a Theme Customizer Control for Posts_Per_Page
- Order posts by custom column using pre_get_posts
- Get the tax term in which is a post via wp_query
- Looking for a way to exclude frontpage and nav menu from query filter
- pre_get_posts redirecting
- WP_Query with tax_query not working
- Custom query with custom filtering returning incorrect results