Just in case anyone happens to run into this same problem, my round-about solution for taxonomy template query conflict:
- clone the main query
- NULL the query
- define new WP_Query
- re-instate cloned query
Tested and working in header.php
<?php
global $wp_query;
$temp_query = clone $wp_query;
global $post;
$temp_post = clone $post;
$wp_query = NULL;
$wp_query = new WP_Query( $args );
// THE LOOP
wp_reset_postdata();
$wp_query = clone $temp_query;
$post = clone $temp_post;
?>
Related Posts:
- Best Practice for PHP
- retrieve thumbnail from post ID of best selling product in category
- How to create a WP_Query to search the Title or Tag?
- how to display active, upcoming and past event with featured listing with pagination
- Get list of WP Updates Across Sites
- if statement on database query
- Duplicates with WP_Query loop
- WP_Query meta_query results date by date
- WP_Query sort using multiple numeric meta values
- Help with adding pagination to custom wp_query
- How to get to a specific position in wp_query?
- API response to be stored locally
- Use wp_get_recent_posts with search term
- WP_Query loop, does not display special characters in title correctly
- Remove query string specific key value
- How to filter posts by post format “standard” from wp-json api?
- Adding country tags automatically
- Using foreach loop breaks
- Advanced Meta Query for Large Calendar Website (12k+ posts) (175k+ wp_postmeta rows)
- Loading the same WP_Query in two different wordpress .php templates
- How to prevent WP_Query function from returning all posts when empty?
- How to store post ID’s in cookie or session to display the same posts later
- Get users that likes the post
- Recent Posts Not Showing Only On A Specific Category Page [closed]
- auto-populating custom nav with all items from custom post type
- inserting a post from an extern php file but post content doesn’t show on wp site
- Create a Blog Template Page
- Exclude posts with specific metadata from search?
- Display an image if odd number of posts in grid
- php within html within php
- Why doesn’t PhotoSmash plugin play well with wp_query?
- the_posts_pagination() not working in wpquery
- How to show meta value code HTML after x paragraph
- Form search query – displaying ACF “Post Object” field as results
- get_the_ID() doesnt work
- change the default order of posts only for specific categories
- Getting posts to exclude from array
- Custom post type permalinks do not appear using the link functions
- extract serialized array to use for wp-query
- How can I split my query result in 2 arrays?
- array_rand not working correctly?
- How to get post category list as select in front-end?
- Order a WP_Query by meta value where the value is an array
- How do I check if there is a tag in the title
- How to extract information from a wp_query result?
- Using multiple variables to assign categories to an array
- Search.php gets metadata from first post
- the_post(); prints out style text into my HTML?
- orderby meta_value_num is not working, giving default order
- How can I modify this code to make the search box include tags and meta
- Let current user know pending posts counts using wp_query
- get_terms with specific id order
- “pre_get_posts” orderby custom date field in different format?
- WordPress Search Ajax + Isotope + InfiniteScroll
- How do I make these combination select filters work when only one dropdown is set? They work in WordPress 5.8.2 but don’t in 5.8.3
- wp_query – Exclude the first thumbnail from lazy loading on archives
- How to call my PHP function with AJAX ? wp_query
- Usermeta data unserialize, extract and display in table in WordPress
- Query by pagename not Working
- Query on a repeater date (acf)
- Display featured image of post type category
- can I extend the WP_Query class to deal with ‘duplicate’ posts created by joining to wp_posts?
- Trying to get pagination working on WP_Query() post grid
- Check the database for a postmeta field
- Getting info about selected posts using one WP_Query
- WP_Query To Display Product Of Brand On Taxonomy Page
- Combine multiple queries, array_unique returns nothing
- How to display last whole post on the homepage
- wordpress query returning unexpected results
- Custom Post type Ajax search results
- How to return count of items found in SQL query
- Display only upcoming events / Show all events when archive year is selected
- wp_query beginner
- Transfer WordPress Login Session to an Extended Webpage on the Same Domain
- How can I display a query in a page?
- For each 3 posts, show a different post type
- Add post class in custom loop (WP_QUERY)
- WooCommerce – Print Processing orders [closed]
- Weird Behaviour: Not all WordPress Posts appearing
- List of child pages fetch next results at link click
- Query category-specific, paginated posts and allow viewer to change sort order
- wordpress is_main_query() breaks
- Why does WP_Query show only the same post even with different categories and endwhile?
- allow previews outside wordpress folder (Outsourcing WP previews)
- How to get category pages to look like a certain archive page?
- show/hide attachments
- Post Title Not showing up
- reorder a WP_Query, using a dropdown
- Custom query_posts() parameter
- Why does a meta_query break this WP_Query?
- How to modify this function to exclude also the post belonging to a specific category?
- Display biography post for today’s birthday person
- How do I run the following script from my articles page?
- Execute multiple PHP Snippets causes error?
- How to initialise WP_Query on the basis of a specific meta_value and continue iterating rest?
- Three different queries on same page
- How to sort custom sortable column by custom table value
- /page/2/ redirect to 404
- How to sort search result by post_title, then by post_content
- How to get posts by a certain author in inner loop using outer loop variable or post title WordPress