5 Responses to Tag Cloud Filter to Show Current Tags

  1. Dan comments:

    I added the reset query before the call to wp_tag_cloud and that solved it.

    Thanks again!

  2. Dan comments:

    Hi Michael,
    Sure – this is the link to the site, the page ‘tag-archive’ of a specific tag. the tag is highlighted correctly:
    the tags are on the bottom right side.

    On a ‘single’ post of that tag (click on one of the posts there) the tag is not highlighted:
    (actually now I see that a different tag is highlighted – the last one on the list which is not the correct one, it’s always highlighted on single posts)
    The site is based on a twenty ten theme, I am using just the post tags taxonomy.

    Thanks a lot for your help,

    • michael replies:

      interestingly, the last tag in the list is highlighted in the single post; there might be something in the code of your theme which alters the current query string of the single post.

      try to add ‘wp_reset_query();’ before the call of the sidebar.

  3. Dan comments:

    I used the above code, thanks alot.
    In the tag archive page it does add the “current-tag” class, but when I go into a single page there is no “current-tag” class added to the link in the tag cloud?
    Am I missing something?


    • michael replies:

      hi Dan,
      the code should work on single posts as well; I just double-checked in a local test site with Twenty Ten. are you using any other taxonomy than post tags? have you checked the html output of the single post in your browser to see if the .current-tag class is added? can you send me a link to your site so I can have a look?

Leave a Reply

Your email address will not be published.

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>


This site uses Akismet to reduce spam. Learn how your comment data is processed.