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.