Viewing 15 replies - 1 through 15 (of 19 total)
  • View your source code and you should see it.

    Thread Starter Indojepang

    (@indojepang)

    thanks but it’s not the answer.
    i’m trying to do highlighting the tag..

    I know how to highlight the page is current_page_item and the category is current-cat, but the tag.. i don’t know the css class for it.

    This is the best I could come up with, sorry.
    https://codex.www.ads-software.com/Template_Tags/single_tag_title

    Thread Starter Indojepang

    (@indojepang)

    thanks joni for your help

    Thread Starter Indojepang

    (@indojepang)

    anyone?
    or there is no css class for current tag?

    how is it possible to have a current tag, unless you’re viewing the tag archive?.. at which point it should be obvious by the honking big h1 or h2 tag at the top of the page.

    Thread Starter Indojepang

    (@indojepang)

    yes it obvious enough.. i’m combining tags and categories as list of menus, it’l look strange if the categories highlighted when the tag is not, isn’t it?
    just like my toothless smile ??

    indojepang, I’m in need of the very same thing as you. I have tags combined with categories in my menu system and since the tags don’t receive the “current-cat” class, they don’t highlight like the categories. Did you find an answer? I wish it were as simple as having a “wp_list_tags” like the “wp_list_categories”…

    add me to the list of people searching for this. During my investigation I never found a ‘current class’ assigned to any tags when browsing the tag archive so I guess WordPress isn’t capable of this feature. Or?

    I also have tags in navigation with categories and need to know ‘current class’ for tags – anyone find out how to do this yet?

    Moderator Samuel Wood (Otto)

    (@otto42)

    www.ads-software.com Admin

    There is no “current class” for tags because that doesn’t make any sense. There’s no way to display tags as a list like there is with categories, so there’s nothing to attach a class to.

    If you want a current class added, you have to tell us what the heck you want it added to. What sort of thing are you doing to display tags that you need a “current tag” class?

    I also am looking for the same thing. I have a “Blog” navigation item that highlights, (using “current_item” or “current_item_parent”) when the post is in the “Blog” category.

    When a visitor clicks a tag in a post, it uses the tag archives template, and the “Blog” nav item is no longer highlighted. Category and single templates provide the “current_item” to the nav ul. The tag template needs to provide “current_item” to the nav ul.

    Using WP 2.5.1, Sandbox, NAVT.

    I think I just solved it using this in my CSS:

    body.tag a.navt_clink {
    background-image:url(/wp-includes/images/nav-graphic-blog-current.gif);
    background-repeat:no-repeat;
    }

    Now any post with the class “tag” in the body, I can style my category nav link.

    mikedev, I’m glad that worked for you. My problem (and I think also some of the others above) is that we’re using tags in navigation lists like categories. Below is how I list some categories and the li automatically gets the “current-cat” class, when on that category page and it allows me to style differently – works great.

    I’d like to wrap a call listing tags in the same way but it doesn’t pull the “current-cat” class (since it’s a tag), so never styles as it should when on that tag page. We’d just like to know how to have a similar conditional class put on the current tag, so we could have it ‘current’ style like the categories do.

    Thanks for sharing, though. Much appreciated. Someone will figure this out sooner or later. I’d even consider editing the core classes file, if I knew how to modify.

    <li class="cat-group">SomeHeadingName</li>
     <ul class="cat-list">
     <?php [call specific tags here] ?>
     </ul>
    </li>

    Tags and categories are not interchangeable, tags just have less functionality for things like this than categories.

Viewing 15 replies - 1 through 15 (of 19 total)
  • The topic ‘current tag css class’ is closed to new replies.