Use $tax_query = $query->get( 'tax_query' );
to get the existing tax_query, modify it by adding your changes, then use $query->set( 'tax_query', new_$tax_query
); to put the whole thing back.
Related Posts:
- WordPress category & taxonomy loop with pagination
- have_posts() return false but count says “3”
- Get posts that matches specific terms of multiple custom taxonomies
- Filtering posts by multiple taxonomies
- Using get_term() in functions.php results in Invalid taxonomy error
- How to return only one instance of each, from the entire loop
- Displaying terms based on loop posts?
- I write simple wordpress loop for taxonomy.php file but don’t show result
- Distribute Gallery Images Every nth in Loop
- Trying to get property of non-object in shortocde
- Display name of taxonomy once
- Get most recent post for every term in a given taxonomy type
- How to use this $tax_selection variable in this custom loop?
- Avoid WP_Query’s duplicate posts with taxonomies
- Use ACF Category Image for all Taxonomy Archive Views
- dispaly all hierarchical post types from a taxonomy
- Loop shows post 5 times in a query
- Attachment Metadata inside of Loop
- Creating a archive for taxonomy terms, not the term results
- Counting the posts of a custom WordPress loop (WP_Query)?
- Get post content from outside the loop
- How to split a loop into multiple columns
- Is it necessary to reset the query after using get_posts()?
- Is there any difference between the_title() and echo get_the_title()?
- Pagination not working on home page
- save_post + insert_post = infinite loop
- Get ID of a page containing secondary loop in content
- is_home, and is_front_page conditional problem
- Is `query_posts` really slower than secondary query?
- ACF Repeater loops and resets – where is the reset_rows() documentation? [closed]
- Exclude category by slug for for each loop
- WordPress Loop Through Particular Pages
- Display date only once for a each set of posts relating to that date
- Load comments per post on click with AJAX
- The main Loop is not starting in a custom blog template page
- connect last post with first post
- Chopping up a large ajax request of around 200 posts [closed]
- Combining the_excerpt with the_content
- Custom loop with conditional statement to separate each terms
- WordPress Loop – Not returning projects in specific category
- Next and Previous loop
- Show the page title on blog page
- Query reset problem or flawed code to enable custom post type query
- How do I order my loop query?
- Orderby my needs in foreach loop like by title or something?
- How to show posts with multiple tags on tag.php?
- Exclude posts from main loop based on meta value
- trouble calling an import class from an action in a plugin before wp_cron executes
- Blog page Server error 500 with stick post loop in query.php
- How can I paginate this?
- Obtain page data and use regular loop
- How can I load posts starting from, and including, the current post?
- How to fix pagination for custom loops?
- ‘Auto Draft’ Post showing in wordpress loop
- How do I display an image before the first post of the loop when I’m using get_template_part?
- Multiple get_posts() queries on one page
- Change date format
- Custom loop not working
- How to stop the continuation of posts on the second loop from where the first ended
- In Custom page – next_posts_link Not working while previous_posts_link is working
- Escape current post from loop
- Why isn’t my multiple loops working?
- How do I display the latest posts from three different categories?
- facebook like, tweet and google+1 buttons inside the loop on home, archive and search pages and missing facebook like buttons
- How do I put my frontpage featured image in a page template for home.php?
- How to print redux gallery feilds id? [closed]
- Why the first with flexslider appears as blank on my code?
- Rendering pages
- add_action in the loop hooks
- How can have a conditional template tag based on the main loop within a secondary loop with new WP_Query(), using get_template_part()
- Reset Loop get_posts();
- WP_Query is only looping home page, not pages
- How to filter posts by category INSIDE the loop
- Offset Loop by 1 , Limit next loop to 1 (Most Recent) Post
- How to show multiple attachements together with Scribu’s Posts 2 Posts connector?
- Custom Header added within Dashboard pages, is this possible with custom template files?
- Loop order issue with Ajax filter
- Adding a second loop breaks everything
- Need to while loop and display contents in the subfield of a group field given by ACF
- Custom Query with Sticky Posts
- How to display a loop of custom post types in columns
- is it bad to copy the loop for a template?
- I want to load post in bootstrap Modal dynamically
- WordPress Modal showing posts not working properly
- Query posts and display all dates in repeater field in chronological order
- Return only one post format in index.php [duplicate]
- Multiple loops in set intervals with code in between
- Only seems to be displaying one child when there are supposed to be multiple
- Modify widget to output posts in custom order
- How to execute custom loop before loop content?
- Limit article to 100 characters. Can’t use the_excerpt…
- Return only content in excerpt field in loop
- This webpage has a redirect loop issue with SSL page
- Buddypress Group Activity Loop Filter activity type [closed]
- get_posts and wp_autop (remove filter)
- Trouble preventing duplicate posts between 2 loops on homepage
- $do_not_duplicate is not working in genesis theme
- Loop displays current page
- Order Categories by Character Count
- Use Base-URL with Query-Loop