• I am trying to show a tag cloud in my sidebar for posts from one category only.

    I have two categories: “blog” and “book reviews” and within each category posts may have the same tag. For example, there may be a blog post tagged “video” and a book review post tagged “video”.

    What I want is to have the tag cloud on the blog page only return posts for the blog category and the tag cloud on the book review page to only return book reviews.

    I was able to exclude the category “book review” id=16 from the loop on the index.php page using the following before the loop:

    <?php
    	if (is_home()) {
    	$paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
    	query_posts("cat=-16&paged=$paged");
    	}
    	?>

    Book reviews do not show up within the page. However, they DO show up in the tag cloud on the page, which I am calling with the following.

    <?php wp_tag_cloud('smallest=100&largest=100&unit=%number=0&format=list'); ?>

    Anyone have an idea how to exclude posts from a particular category from showing up in the tag cloud on a particular page??

Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Exclude posts from a category from appearing in Tag Cloud’ is closed to new replies.