Forums

Exclude posts from a category from appearing in Tag Cloud (4 posts)

  1. milo2man
    Member
    Posted 1 year ago #

    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??

  2. MichaelH
    moderator
    Posted 1 year ago #

  3. milo2man
    Member
    Posted 1 year ago #

    Thanks MichaelH

    I tried the suggestions on the thread http://wordpress.org/support/topic/144220 and with the help of the Sensitive Tag Cloud plugin was able to get my home page to only show tags from posts in the blog category.

    However, the page with book reviews is showing the same tags (from the blog category) and not from the book review category.

    Anyone else have this issue with the sensitive tag cloud plugin? Works on home page but not on other pages?

  4. MutualDesigns
    Member
    Posted 2 months ago #

    I want to do the same thing you are looking to do! Any suggestions would be great!

Topic Closed

This topic has been closed to new replies.

About this Topic