I have this function
$tags = get_tags( array('exclude' => 11, 12) )
Which excludes specific tags 11 and 12. But without manually having to add each tag ID I don't want shown, how do I exclude the category that these tags are coming from?
Since this question is too hard to ask, I'm going to use custom taxonomies. Thanks for your help so far, everyone.
You could get all of the term IDs for the badcategory
and use those in your exclude filter:
$bad_terms = get_terms( [ 'taxonomy' => 'badcategory', 'fields' => 'ids' ] );
$good_tags = get_tags( [ 'exclude' => $bad_terms ] );
get_tags()
doesn't make any sense. They're already not going to be included.
Commented
May 2, 2019 at 9:29
if
statement to skip over those 2 tags