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>

...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

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>
    <?php wp_nav_menu(array('container'=>false) ?>
| improve this answer | |

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.