I want to wrap each sub-menu ul and the tag just before it with a div.
I can create the opening tag using the 'before' attribute of wP-nav_menu like this:
wp_nav_menu(array(
'before' => '<div class="child-wrap">'
));
The div then needs to close after the link but also after the submenu so the output is:
<ul>
<li>
<div class="child-wrap">
<a href="...">Menu Item</a>
</div>
</li>
<li>
<div class="child-wrap">
<a href="...">Menu Item</a>
<ul class="sub-menu">
....
</ul>
</div>
</li>
</ul>
I know I can use a Walker but I really don't understand how it works (inside the walker class) so any help would be appreciated...