We know that we can check if the particular post has a term by using this code:
has_term('term', 'taxonomy', $post->ID )) {
I was wondering if there is a code to check if a particular post does not have a particular term.
Thanks.
We know that we can check if the particular post has a term by using this code:
has_term('term', 'taxonomy', $post->ID )) {
I was wondering if there is a code to check if a particular post does not have a particular term.
Thanks.
if ( !has_term('term', 'taxonomy', $post->ID )) {
Use the NOT (!
) operator