• nubijoe

    (@nubijoe)


    I think this is a very standard question.. I have searched the forums, and I’m feeling like a complete tool, because I can’t figure out how this works. But if anyone could please help me, or point me towards solution, I would be very pleased.

    I am using this code to make my menu:

    <div id=”menuitems”>

      <?php wp_page_menu(‘show_home=1&title_li=’); ?>

    </div>

    Additionally, I am using this code to highlight the current page:

    #menuitems .current_page_item a:link, #menuitems .current_page_item a:visited {
    color: #000;
    background:#877474;
    }

    I need to do, so that the specific item in the menu is still highlighted, when I’m on single.php and category.php ? I reckon som sort of conditional approach, but I’m too much of a novice to make it up myself.

Viewing 6 replies - 1 through 6 (of 6 total)
  • esmi

    (@esmi)

    Unless you provide a link to a page demonstrating the problem, no one will be able to offer much in the way of assistance.

    Thread Starter nubijoe

    (@nubijoe)

    I can’t really link to the site.

    I’ll try to explain myself better.

    I have a menu that is created through wp_page_menu.

    One page is called “Blog”. When I click the blog-menu link, all the blog posts are shown along with a submenu consisting of the subcategories within the “”blog category. When I click one of these subcategories, I am sent to category.php and then the “Blog” menu link is no longer highlighted.

    Furthermore, if I press one of the posts that is listed on category.php, the “Blog” menu link is no longer highlighted.

    esmi

    (@esmi)

    If we cannot see the site, we can’t really help. All I can suggest is that you use Firefox with Firebug to track down the relevant CSS.

    Thread Starter nubijoe

    (@nubijoe)

    Ok, let me ask you this then, if you dont mind 🙂

    Is the current menu item supposed to be highlighted when I am on single.php and category.php by using current_page_item ?

    Thread Starter nubijoe

    (@nubijoe)

    Because when I am on single.php or category.php, and I look through the source code, then neither of the page items in the menu has the current_page_item class.

    esmi

    (@esmi)

    Is the current menu item supposed to be highlighted when I am on single.php and category.php by using current_page_item

    That really depends upon what’s in your menu. If you are displaying category links, then the current category link should be highlighted when you are displaying that category

Viewing 6 replies - 1 through 6 (of 6 total)

The topic ‘Highlight menu item when on single.php and category.php’ is closed to new replies.