• I am new to the wordpress dynamic menu and am a designer with limited PHP knowledge. I just started using the <?php wp_nav_menu( array('menu' => 'Main' )); ?> tag and it works great.
    I have a menu but want to know a simple way to be able to highlight the current page you are on in the navigation. (Ex. If we have three nav links: about, blog & contact. When I am on the “about” page I would like to change the color of the link to black from light grey.)

    Thanks for any insight!

Viewing 3 replies - 1 through 3 (of 3 total)
  • WordPress automatically outputs all of the ids & classes that you need for this. Did you try examining the source of the generated menu?

    Thread Starter danrood

    (@danrood)

    Does the code automatically know what page you are on and all I have to do is find the right element to put a color style to?

    Yes. It automatically determines which page you’re on and adds the appropriate class. It also adds classes if you’re on a child or other descendant page, on a category, tag, post, etc.

    You’ll look for classes like current-menu-item, current-post-ancestor, etc. They’re pretty straightforward. Just look at the source code of your menu in various spots on the site to see how it works.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Dynamic Nav Hightlighting WP 3.5 – using wp_nav_menu’ is closed to new replies.