How do I hook into the container of wp_nav_menu?


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?

SinisterBeard 2 months 0 Answers 8 views 0

Leave an answer