I can do something like the following with a standard category:
$query->set('category__not_in', $term_id);
But how do I do the same with a custom taxonomy term?
I'm using Wordpress 3.3.1 if it is relevant. Thank you. :)
|
I can do something like the following with a standard category:
But how do I do the same with a custom taxonomy term? I'm using Wordpress 3.3.1 if it is relevant. Thank you. :) |
|||
| show 2 more comments |
|
For what it's worth, I just gave up on the '__not_in' approach and went with the following somewhat sneaky solution:
|
|||
|
tax_queryif you want to build a new query. If you want to modify one, then re-build your initial query to usetax_query, then add a filter toposts_clausesand dump$pieces. Then just copy/paste your initial query from the dump, move it to the filter and use the default query (altered via the filter). This saves you a query per request as WP is doing one per default and every custom query is a new one. – kaiser Jan 18 '12 at 1:13