Exclude a category from Tag search
-
I have a page that’s pulling all posts that have a specific tag, but I’m trying to exclude one category. I’ve put together this code, but it’s still pulling from that category. Any help would be appreciated!
<?php $args = array('tag_slug__and' => array('Artist'), 'categories' => '-20'); $postslist = get_posts( $args ); foreach ($postslist as $post) : setup_postdata($post); ?> Content here <?php endforeach; ?>
- The topic ‘Exclude a category from Tag search’ is closed to new replies.