I'm thinking about wrapping the wp_nav_menu
with a nav tag instead of a div tag.
I've read at the WordPress codex that the container argument is only for using ul
or div
.
Do you guys know a way how to display the navigation in a nav tag so that the output looks like this:
<nav class="menu-header-menue-container">
<ul id="menu-header-menue" class="menu">
<li id="menu-item-86" class="menu-item menu-item-type-custom menu-item-object-custom menu-item-86"><a href="home"></a></li>
</ul>
</nav>
I'm thinking about wrapping the wp_nav_menu
with a nav tag instead of a div tag.
I've read at the WordPress codex that the container argument is only for using ul
or div
.
Do you guys know a way how to display the navigation in a nav tag so that the output looks like this:
<nav class="menu-header-menue-container">
<ul id="menu-header-menue" class="menu">
<li id="menu-item-86" class="menu-item menu-item-type-custom menu-item-object-custom menu-item-86"><a href="home"></a></li>
</ul>
</nav>
You were really close.
There is container
argument for wp_nav_menu
:
'container' (string) Whether to wrap the ul, and what to wrap it with. Default 'div'.
Its default value is 'div', which means, that the ul
will be wrapped with div
tag. You can change it to false
- ul
won't get wrapped at all in such case.
But you can also change it to nav
- and that is what you're looking.