WordPress.org

Ready to get started?Download WordPress

Forums

MAIN NAV HIGHLIGHTING ALL SUB-MENU LINKS (5 posts)

  1. angschmidt
    Member
    Posted 2 years ago #

    #header-menu .current_page_item a,
    #header-menu .current_page_ancestor a {
    color:#0f47a6;

    }

    I need your help! I have tried a bunch of combinations, but I cannot get the sub-menu links to not all highlight. I have top level navigation and sub level menus. When a click on a top level link — it will turn blue and all of the sub-menu links turn blue also. What can I do to fix this current page highlighting?

    Thanks

  2. dkotter
    Member
    Posted 2 years ago #

    If you have a link to your site, it will be easier to debug.

  3. angschmidt
    Member
    Posted 2 years ago #

  4. dkotter
    Member
    Posted 2 years ago #

    Okay to fix it, you'll need to make a small change in your CSS file, which you can either edit locally and upload it via FTP, or you can edit it via the WordPress Admin.

    So go to that file, and around line 142 you should find this declaration:

    #header-menu .current_page_item a,
    #header-menu .current_page_ancestor a {
        color: #0F47A6;
    }

    Basically what that does is change the color of the text to the blueish color you're using, on any links that are part of the current page. So to make it only happen on the top link, you'll need to make one small change:

    #header-menu .current_page_item > a,
    #header-menu .current_page_ancestor a {
        color: #0F47A6;
    }

    Just add the > in the first line and this will make it target only the first links.

  5. Pedromrferreira
    Member
    Posted 2 years ago #

    Thanks man, that helped me alot!

Topic Closed

This topic has been closed to new replies.

About this Topic