Adding a tax_query to a WP_Query Object
If you instantiate WP_Query with arguments, as in your second example, then the query is performed right away, and setting new arguments will not change the results. $q = new WP_Query( [ ‘post_type’ => ‘post’ ] ); $q->set( ‘tax_query’, [] ); // Too late. If you instantiate WP_Query without arguments, like this: $q = new … Read more