tax_query will produce nothing

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, ] ],

WordPress tax query use operator LIKE

The only option you have is to write your own SQL into the posts_clauses filter, where you get an array of the JOIN, WHERE, ORDER, etc. clauses that you can alter, add to, remove, etc. One MAJOR MAJOR note on this, is ALWAYS use the global $wpdb‘s prepare function, which will sanitize all your lovely … Read more

tech