Exclude custom taxonomy from wp_query
I am trying to figure out how to exclude a custom taxonomy from a wp_query I am running. I have set up a custom post type and registered a new taxonomy and with no trouble at all I can include the taxonomy in the query array with
'taxonomy' => 'slug'but instead of including I want to exclude a single slug from the query.
I have tried solutions such as post__not_in, cat=-ID, etc. with no luck.
I have yet to find a proper solution on the codex, forum, or anywhere else for that matter. This may be something simple and I need sleep, but any help would be amazing!
Here is the whole query and array. Here ‘projecttype’ is the custom taxonomy as part of the custom portfolio post type. Instead of including the ‘featured’ project type I want to exclude it.
new WP_Query(array('projecttype' => 'featured', 'post_type' => 'portfolio', 'posts_per_page' => 1));
- The topic ‘Exclude custom taxonomy from wp_query’ is closed to new replies.