0

I know I can edit the items within the wp_nav_menu by declaring a custom walker, but I want to add some code just inside the container, which isn't handled by a walker.

It's in nav-menu-menu-template.php, so I can get the desired effect by adding my code after line 329...

$nav_menu .= "<div class='topper'>
                  <a href='".get_home_url()."' class='intranet'>H</a>
              </div>";

...but of course this will disappear on an update. What hook do I need to achieve the same?

  • 1
    After the container, or after the nav menu but inside the container? – TheDeadMedic Sep 23 '15 at 12:15
  • @TheDeadMedic After the nav but inside the container. – SinisterBeard Sep 23 '15 at 12:56
0

Solved it by setting container to false and then wrapping it manually.

<nav class="main_navigation">
    <div class="topper">
        <a href="<?=get_home_url()?>" class="intranet">H</a>
    </div>
    <?php wp_nav_menu(array('container'=>false) ?>
</nav>

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.