WordPress.org

Forums

Highlight Home menu (3 posts)

  1. kristel_ttm
    Member
    Posted 4 years ago #

    It's a subject that has been already mentioned many times but despite me reading all concerned posts I still was not able to make this work.
    I'm quite a beginner though.

    Thanks to a tutorial on the net, all my menu buttons are now highlighted for the current page except for 'Home'. I understand I need to add a " current page item class " to <php if(is_home)()?> somewhere. But where ? Which template ? I can't find anything in header.php.

    I am using the twenty ten theme and here is my site: http://www.djpromo.nl/wordpress

    Thank you in advance !

  2. cubecolour
    ɹoʇɐɹǝpoɯ
    Posted 4 years ago #

    In the style.css find where your style for the current link is defined

    #access ul li.current_page_item > a,
    #access ul li.current-menu-ancestor > a,
    #access ul li.current-menu-item > a,
    #access ul li.current-menu-parent > a {
    		background: #333;color: #fff;}

    Add this line at the top:

    .home #access ul li.menu-item-home > a,

    so it looks like this:

    .home #access ul li.menu-item-home > a,
    #access ul li.current_page_item > a,
    #access ul li.current-menu-ancestor > a,
    #access ul li.current-menu-item > a,
    #access ul li.current-menu-parent > a {
    		background: #333;color: #fff;}
  3. kristel_ttm
    Member
    Posted 4 years ago #

    Damn, I still have a lot to learn ! I can't believe it was that simple. I thought I needed to modify a template. Thank you VERY much cubcolour !

Topic Closed

This topic has been closed to new replies.

About this Topic