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
- WordPress tax_query “and” operator not functioning as desired
- Custom Taxonomy and Tax_Query
- When/why does ‘$query->get( ‘tax_query’ );’ return empty?
- pre_get_posts with tax_query causes empty result
- search query within custom taxonomy term, post title and meta field
- Sorting a list of posts displayed under a list of associated terms (which should be sorted without initial articles)
- WooCommerce: filter by parent product’s taxonomy and product variation’s meta data
- Query set using tax_query with relation ‘OR’ modifies category object?
- How to combine tax_query and date_query in WordPress
- Specify number of posts in my ‘tax_query’
- Problem with get_posts, tax_query and counting the number of posts
- Querying by taxonomy vs Querying by Custom fields Speed Comparison
- Using tax_query reverses my post_type argument in a custom WP_Query
- List taxonomy / category count showing list published posts only
- tax_query shows no results if nothing is selected
- get complex results set according to category structure
- Dynamically tax_query terms
- WP_Query tax_query problem
- Woocommerce change tax rate programmaticly
- How do I sort posts by custom taxonomy?
- Empty tax_query array returns an empty array
- Query custom post type by category slug
- Taxonomy archive showing no results
- ?cat=-1 Indexed Versions Of Homepage
- Tax query not producing any results
- How to Filter custom post type by taxonomy?
- Tax Query for custom Taxonomy field
- Tax query in pre_get_posts not working
- Retrieve Custom Taxonomies according to posts selected
- More then one menu items are assigned with “current-menu-item” class
- How do I display the grand child items of a taxonomy term?
- How can I hide uncategorized products from search results?
- 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
- exclude product with available tag
- 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
- Is it possible to add relation between meta_query and tax_query?
- 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
- Exclude post type with pre_get_posts?
- 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
- Facing problem with tax_query results
- 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
- How to get rid of variations with unspecified attributes
- Can I create a tax query to return posts that match two slugs from same taxonomy
- How to search through all child taxonomies using WP_Query?
- 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?
- WordPress post_status and meta_query
- 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 display just video post format?
- 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)
- Empty ‘terms’ in ‘tax_query’ returns an empty array
- WP_Query: Meta_Query with serialized value (or a workaround)
- Multiple tax_queries: display posts titles from several custom taxonomie
- 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
- Custom query with custom filtering returning incorrect results