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
- 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()`
- tax_query will produce nothing
- 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?
- Combine tax_query and meta_query in WP_Query
- Find all product that contain terms with %keywords% in WP_Query
- Get term by custom term meta and taxonomy
- How to Get All Taxonomies AND All Terms For Each Taxonomy With Post Count Zero
- tax_query: What to pass when I want to have all terms?
- WP_Tax_Query with post_tag not working
- How to add terms to my tax_query based off of the current post
- Query for custom post type objects in a taxonomy and with a meta value
- Query all posts in a given taxonomy
- Display related products with custom output
- Is it possible to dynamically get queried term AND taxonomy?
- Get pages only with a specific taxonomy
- Get list of terms that have posts in another term
- 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?
- Get taxonomy parent using child slug (from merged taxonomies)
- Fetch posts that match term slug first two letters (wp query)
- Manipulate WP Query using a custom post type and multiple tax_query taxonomies
- WP_Query tax query part of slug
- Searching in title or meta, with a tax query too!
- Taxonomy Query Relation field not behaving correctly?
- Why is this query not working? (Standard posts + custom post type)
- Tax query AND/OR meta query [duplicate]
- Custom Taxonomy Not Working When added to WordPress Search
- WordPress tax_query not showing private posts
- Exclude posts which have any term in a certain taxonomy from the query
- WP_query – Filter by tax_query and meta_query using multiple select
- How to get the id or url of the image in an image post?
- Tax Query only returns for the first of several terms
- get_posts( $args ) return empty data
- 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
- Loop posts based on permalink term
- tax_query (if the terms are empty)
- tax query shortcode
- How to restrict search on a certain page to only return results against custom taxonomies?
- 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 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?
- Hi need update in my terms for other taxonomy
- Get Posts Related to Category By category id or slug
- 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
- Display just the Post’s parent Category, not child
- Show posts from two specific category in WP_Query
- 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
- Can I create a tax query to return posts that match two slugs from same taxonomy
- how do you pull data from two taxonomies?
- 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
- Tax_Query not working – connecting to second wordpress database
- 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