Looking at the WP_Query documentation on tax_queries we can see it accepts a nested array as a parameter. Compare that to the provided code:
'tax_query' => array(
'taxonomy' => 'news_category',
'field' => 'term_id',
'terms' => 82,
),
Should look like:
'tax_query' => [
[
'taxonomy' => 'news_category',
'field' => 'term_id',
'terms' => 82,
]
],
Related Posts:
- WordPress tax query use operator LIKE
- tax_query will produce nothing
- Multiple, nested tax_query relation
- Can’t make a tax_query across different post types
- How to write a Tax Query that matches all terms in an array?
- using multiple terms in tax_query
- in_category() and tax_query with custom post type
- OR for a single taxonomy in a tax_query
- simple tax_query intersection
- How to set `tax_query` with `query->set()`
- Nested meta_query with multiple relation keys
- “tax_query” parameter not working with WP_Query
- Multiple relationship for multiple tax_query in WP_Query
- Query posts by custom taxonomy ID
- Does tax_query really beats meta_query in all situations?
- Including all terms in wordpress tax_query
- Tax_query terms ID’s using variable
- The Operator “NOT IN” Does Not Work In tax_query
- How to tax query X number of posts related by tag first, then by category if not enough in tag-related
- Why is my WP_Query not working when tax_query terms are an array?
- get_terms with posts that have a different taxonomy with term x
- template_include for search.php makes WordPress think its on the home page
- Using tax_query creates a 1 = 0 or 1 = 1 in $wp_query->request
- Hidden woocommerce products still showing up in search results [closed]
- How to create a WP_Query to search the Title or Tag?
- Count number of posts which exist in 2 taxonomies?
- How to extend tag and category “Related Posts” query to custom post_type if the first 2 terms have no posts
- Find all product that contain terms with %keywords% in WP_Query
- WP_Query tax_query on ACF post_object
- How to add terms to my tax_query based off of the current post
- How to output content based on same custom taxonomy?
- Query all posts in a given taxonomy
- Change default ordering of taxonomy terms – pre_get_terms
- WP_Query, tax_query and term_meta: How to?
- Is it possible to dynamically get queried term AND taxonomy?
- How can i simulate “taxonomy__in” in query?
- Get pages only with a specific taxonomy
- How to add autocomplete to custom taxonomy for CPT
- pre_get_posts: using tax_query only for certain post type
- pre_get_posts Remove tax_query Completely
- $wpdb: Counting posts corresponding to 3 terms in 3 different taxonomies
- Query Multiple Taxominies Across Multiple Post type’s
- Meta Query relation “AND” not working
- Nested tax_query that allows specified categories OR tags, but NOT other categories
- How can I add multiple ‘tax_query’ arrays via a loop?
- Populate tax_query terms parameter with post term
- Fastest way of counting posts of a custom post type in a specific taxonomy term?
- 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?
- Why is this query not working? (Standard posts + custom post type)
- Using meta_query and tax_query at the same time
- Tax query AND/OR meta query [duplicate]
- Custom Taxonomy Not Working When added to WordPress Search
- Hiding taxonomies with no children WP_Query & tax_query
- Exclude posts which have any term in a certain taxonomy from the query
- How to display Related Posts based on number of taxonomy terms matched
- WP_query – Filter by tax_query and meta_query using multiple select
- Tax Query only returns for the first of several terms
- Set both meta_query and tax_query using wp_query->set
- tax_query: Don’t show posts with parent term when they have a corresponding child term applied
- $query->is_main_query() is causing query’s tax_query to be ignored
- How to print term name inside wp post loop
- Loop posts based on permalink term
- tax_query (if the terms are empty)
- tax query shortcode
- Function using get_posts() with tax_query not working when called from functions.php
- Running a custom query inside another cpt single and trying to grab a variable
- WP_Query tax_query – Show results if child has parent X
- how to access the $query variable inside taxonomy-xxx.php template file?
- how to use tax_query to apply both terms or one if one is empty
- Show multiple tax_query from 2 or more post_type in a single code
- Query all posts under one taxonomy? Why is my code not working?
- Get Posts Related to Category By category id or slug
- problem with setting tax_query in pre_get_posts
- Display just the Post’s parent Category, not child
- AJAX not working when clicking load more button, when two terms are present in tax_query
- Show posts from two specific category in WP_Query
- I’m having trouble with Related Product “tax_query” ‘terms’ value
- Display related CPT with custom taxonomy
- WP Query should show No Posts when tax_query $args taxonomies don’t have associated posts
- Tax query get first product with attribute value in pre_get_posts
- WP_Query for a taxonomy value OR a custom post type meta field
- Sort by an ACF field in a tax_query
- Why pagination is not working with tax_query param?
- Query child posts with tax query on parents
- posts_per_page in a tax_query
- Getting Custom Posts with Custom Taxonomy
- Not able to get my custom search result using meta_query and tax_query together?
- Error get_posts with Custom Taxonomy and OR relation
- How to show post which has the specific taxonomy terms?
- Woocommerce orderby rand with tax_query not random
- Custom taxonomy and query multi conditions
- Escaping WP_Query tax_query when term has special character(s)
- Display related posts with same category or same tag return blank
- WordPress hiding posts without content on custom taxonomy query. How to solve?
- Custom Query Arguments
- How to limit posts to 1 from each term with tax_query?
- How to pass >= condition filter to my year custom tax_query
- wp_get_object_terms count on taxonomies within an category archive