Hi,
the query should be corrected a little.
In your case you want to display any published post that is not under back-issue term of taxonomy. First of all: what’s the name of this taxonomy? For example, “category” is the name of a taxonomy, like post-tag is the name of another taxonomy. In the code you entered, the name of the taxonomy is missing:
[taxonomy] => back-issue <<<=== This should be the name of the taxonomy
...
[0] => back-issue
So, let’s see an example.
In my site I want to display posts from the custom post type product. I do not want to display products that have an HD display.
In this case:
– display is the name of a taxonomy
– hd is a term of the taxonomy display.
The query will be:
$pis_query = Array
(
[post_type] => product
[tax_query] => Array
(
[0] => Array
(
[taxonomy] => display
[field] => slug
[terms] => Array
(
[0] => hd
)
[operator] => NOT IN
)
)
[posts_per_page] => 6
[orderby] => date
[order] => DESC
[post_status] => publish
)
The following are two screenshots of the widget panel:


Let me know, please.
-
This reply was modified 9 years, 1 month ago by
Aldo Latino.
I think I executed this correctly (thanks for the very clear explanation) but I am still not getting anything but “no posts yet.” I am not sure if I have perhaps not gotten the taxonomies set up correctly to begin with, or if I am still inputting things incorrectly.
My terms are set up as categories (‘issue’ and ‘supplement’) and tags (‘back-issue’)
Debug results following what I think was the correct implementation based on your explanation:
<code>
"$pis_query = Array
(
[post_type] => product
[tax_query] => Array
(
[0] => Array
(
[taxonomy] => issue, supplement
[field] => slug
[terms] => Array
(
[0] => back-issue
)
[operator] => NOT IN
)
)
[posts_per_page] => 2
[orderby] => date
[order] => DESC
[post_status] => publish
)"
</code>
-
This reply was modified 9 years, 1 month ago by
anomalocaris.
-
This reply was modified 9 years, 1 month ago by
anomalocaris. Reason: formatting issue
In the query, this line
[taxonomy] => issue, supplement
must contain the name of the taxonomy, not the terms of the taxonomy.
Knowing that:
– issue and supplement are categories;
– back-issue is a tag;
– you want to display any product (a custom post type), regardless of the category;
– you want to hide posts tagged with back-issue
here is the correct query:
$pis_query = Array
(
[post_type] => product
[tax_query] => Array
(
[0] => Array
(
[taxonomy] => post_tag
[field] => slug
[terms] => Array
(
[0] => back-issue
)
[operator] => NOT IN
)
)
[posts_per_page] => 2
[orderby] => date
[order] => DESC
[post_status] => publish
)
This query will show the most recent two posts published as product, excluding those tagged with back-issue.
Here is the updated screenshot:

Let me know, please.
P.S. After solving this step, I will tell you how to get posts with certain categories and exclude posts tagged with certain tags.
Bingo–worked perfectly. Thank you! I figured I was just not getting a detail and that was screwing everything up.
Looking forward to the explanation about getting posts with certain categories and excluding posts tagged with certain tags. I am guessing it will involve the second column A2 or the B column.
-
This reply was modified 9 years, 1 month ago by
anomalocaris.
Yes, you’re right.
Let’s say that we have a custom post type “product”. We have already published products under many categories and tags. We want to display products published under the “aciform” category, excluding those tagged with “habergeon”.
Since you have already understood the solution, an image should be enough:

This is the resulting query:
$pis_query = Array
(
[post_type] => product
[tax_query] => Array
(
[relation] => AND
[0] => Array
(
[taxonomy] => category
[field] => slug
[terms] => Array
(
[0] => aciform
)
[operator] => IN
)
[1] => Array
(
[taxonomy] => post_tag
[field] => slug
[terms] => Array
(
[0] => habergeon
)
[operator] => NOT IN
)
)
[posts_per_page] => 6
[orderby] => date
[order] => DESC
[post_status] => publish
)
Obviously you can enter more comma-separated categories and/or tags.
In case of custom taxonomies, enter the taxonomy name instead of category and the term name instead of post_tag.
Have fun!
Thanks so much! I am, indeed, looking forward to playing with this.