Forums

wp_nav_menu Current Menu item Highlight (2 posts)

  1. wqsa248
    Member
    Posted 6 months ago #

    Ok so I have 2 different menus running in one page and I would like for the current page highlight image I coded into css to work here. I tried codex but cannot seem to have the correct instructions for wp_nav_menu. Can you specify which code should be added to this so it can highlight the current page people are looking at?

    \\\the page.php code///
    <div id="menu">

      <h4>How To</h4>
      <?php wp_nav_menu( array('menu' => 'How To' )); ?>
      <h4>Tools & Resources</h4>
      <?php wp_nav_menu( array('menu' => 'Tools and Resources' )); ?>

    \\\the page.php code///

    \\\the css//

    #menu ul li a:hover {
    background:url(img/light_blue.png) repeat-x;
    text-shadow:#fff 1px 1px 1px;

    }

    #menu ul li .current {
    background:url(img/light_blue.png) repeat-x;
    text-shadow:#fff 1px 1px 1px;
    }

    \\\the css///

    http://websitemakingtutorial.com/ = The site I am working on.

  2. geeksfolder
    Member
    Posted 6 months ago #

    For the current menu, the class "current-menu-item" will be added to

  3. .
    So you can do something like:

    li.current-menu-item { your css code goes here }

Reply

You must log in to post.

About this Topic

Tags