You can’t set query parameters after the query happens, set them before you make the query-
$args = array(
'post_type' => 'articles',
'paged' => $paged,
);
if( some condition )
$args['tax_query'] = array( your tax params );
$query = new WP_Query( $args );
Related Posts:
- “tax_query” parameter not working with WP_Query
- Custom Taxonomy and Tax_Query
- Including all terms in wordpress tax_query
- Using tax_query creates a 1 = 0 or 1 = 1 in $wp_query->request
- search query within custom taxonomy term, post title and meta field
- why do drafts return as part of wp_query?
- Hiding taxonomies with no children WP_Query & tax_query
- How to do a particular wp_query taxonomy search
- WP_Query tax_query – Show results if child has parent X
- how to use tax_query to apply both terms or one if one is empty
- WordPress hiding posts without content on custom taxonomy query. How to solve?
- How to use tax_query other than by slug or id or solve custom taxonomy tags conflicts with pre-existing tags?
- Advanced AND tax_query in sidebar with 2 taxonomies
- How to limit posts to 1 from each term with tax_query?
- How do I exclude a custom taxonomy from the post loop
- WordPress tax_query “and” operator not functioning as desired
- Using WordPress to make a “Product Search” type navigation drilldown
- Custom Taxonomy not working with posts_per_page in new WP_query (pagination problem)
- display posts with same taxonomy term
- pre_get_posts with tax_query causes empty result
- The Operator “NOT IN” Does Not Work In tax_query
- How to get first post in a category of a custom taxonomy
- wp query with multiple taxonomy?
- wp_query orderby title and meta key value (WP3.1)
- Sorting a list of posts displayed under a list of associated terms (which should be sorted without initial articles)
- Page queried instead of a custom taxonomy
- Custom WP_Query breaks default behaviour of viewing right post associated with tax-term!
- Querying by taxonomy vs Querying by Custom fields Speed Comparison
- Adding session variable and/or cookie based on user-selected input
- List taxonomy / category count showing list published posts only
- Excluding a custom taxonomy term breaks wp_get_post_terms
- Advanced Tax Query
- tax_query shows no results if nothing is selected
- Improving WP_Query performance for multiple taxonomies
- Dynamically tax_query terms
- How to output content based on same custom taxonomy?
- WP Query with custom taxonomy
- how to search in custom fields & custom taxonomy for custom search
- How do I sort posts by custom taxonomy?
- WP_Query, tax_query and term_meta: How to?
- How to add autocomplete to custom taxonomy for CPT
- WP_Query on custom taxonomy works fine but fails if run through wp_ajax_
- Custom taxonomy query not working with switch_to_blog
- Advanced Query Logic With Multiple Taxonomies
- cannot get multiple loops using tax_query
- ‘wp’ action hook not firing in admin and login?
- Taxonomy archive showing no results
- Querying on multiple taxonomies pulled from $_GET checkbox array not working?
- Display all posts for taxonomy term across multiple custom post types
- Selecting all posts from the children of a particular parent taxonomy
- Retrieve Custom Taxonomies according to posts selected
- Custom Taxonomy Not Working When added to WordPress Search
- Can I use OR relation for one item when calling tax_query from WP_Query and use AND for the rest?
- How to display Related Posts based on number of taxonomy terms matched
- querying posts by custom taxonomy terms right from a querystring based URL
- tax_query not working in template
- tax_query not working
- WP_query – Filter by tax_query and meta_query using multiple select
- When filtering query on custom taxonomy; main menu dissapears
- wp_query not resetting, last post hanging
- Using WP_Query and Query_post for the loop?
- WP_Query parameter conflict
- Problem with wordpress pagination
- Tax Query only returns for the first of several terms
- tax_query: Don’t show posts with parent term when they have a corresponding child term applied
- How to print term name inside wp post loop
- Custom Category Walker with Image, Fallback to Most Recent Post in Category Image
- tax_query (if the terms are empty)
- How to restrict search on a certain page to only return results against custom taxonomies?
- check if a taxnomy queried in $wp_query?
- Taxonomy.php how to show post only in current taxonomy with wp_query?
- how to access the $query variable inside taxonomy-xxx.php template file?
- Get current page term title to use in WP_Query
- passing moree than one value of slugs in taxonomy using variable
- Get Posts Related to Category By category id or slug
- Display just the Post’s parent Category, not child
- custom post type and a “sticky” position taxonomy
- How to search through all child taxonomies using WP_Query?
- Tax-query on taxonomy doesn´t work
- list all post who have mutual taxonomy as current taxonomy!
- WP Query tax_query not returning posts
- WordPress Multiple Taxonomy Query
- 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?
- tax_query not working for taxonomy slug
- Custom query for tag and custom tag from 2 post type
- tax_query showing no results
- How do you move custom fields to custom taxonomies using WP Queries
- Run next query based on first query’s term
- Get the original menu item name string instead of the label
- Tax query array terms display out of order
- Order posts with custom taxonomy array
- Getting grandchildren of a post with a specified custom taxonomy?
- Taxonomy Parameters in WP Query to get posts from two different taxonomies
- How to update WordPress custom SQL Select query for custom taxonomies so that syntax is correct?
- How to query posts that are not related to any term of a taxonomy?
- wp_get_object_terms count on taxonomies within an category archive
- WP Query Conditionally query meta and taxonomy
- Complex Taxonomy scheme
- Loop posts without any taxonomy