WordPress.org

Support

Support » How-To and Troubleshooting » Category single #current link

Category single #current link

  • Hi there!

    I’ve got a little problem over here. I want my category link be #current when I’m in a single post also. It works fine when I’m in the category page but when I jump into a single page in a category the current link in my menu don’t appear. Here’s my code:

    <li<?php
    if (is_category('training') || in_category('') && !is_single())
    {
    echo " id=\"current\"";
    }?>>
    <a href="<?php bloginfo('url') ?>/show/training">Training</a>

    Can you see anything wrong with this?

    /Tobias

Viewing 1 replies (of 1 total)
  • This code && !is_single() says to not echo the ID when displaying a single page.

    That is not what you say you want.

Viewing 1 replies (of 1 total)
  • The topic ‘Category single #current link’ is closed to new replies.
Skip to toolbar