How to exclude tags and categories from a function?
I don’t know how the structure of $cat_not_in looks like but make sure that that variable is not an array. If $cat_not_in is an array then you could try if ($cat_not_in) { $args[‘category__not_in’] = $cat_not_in; } if ($tag_not_in) { $args[‘tag__not_in’] = $tag_not_in; } Also see WP Codex – WP_Query it allows for category exclusion by … Read more