Exclude tags from All Queries on Page. (Urgent Help needed)
-
I have the feeling this question has been asked a number of times. I have searched “everywhere” tho, but couldn’t get the exact solution to my problem.
I’m working on a news site theme. I have an index page with three featured items block at the top. I feed items into these three blocks by retrieving posts with the tags featured1, featured2 and featured3 respectively. with 3 queries;
$args = array('showposts' => 1, 'tag' => 'featured1'); $wp_query = new WP_Query($args);
AND
$args = array('showposts' => 1, 'tag' => 'featured2'); $wp_query = new WP_Query($args);
AND
$args = array('showposts' => 1, 'tag' => 'featured3'); $wp_query = new WP_Query($args);
this works very well as expected..
now I have many other queries on this same page that get posts from various categories (about 50 different queries).
I also have a block archiving all my tags.My problem is that I want a general way to stop the currently featured posts with the tags “featured1”, “featured2” and “featured3” from appearing any other place on the page than the featured area. their tags shouldn’t be archived in my tag archive block either.
By “general” I mean that I don’t want to go into these other queries individually and start using ‘tag__not_in’ in them. I want to be able to exclude them (the featured posts and their tags) from every other “activity” on the page.
I’d be very glad to get a solution to this problem.
- The topic ‘Exclude tags from All Queries on Page. (Urgent Help needed)’ is closed to new replies.