Have been asked to redevelop a HTML website in to a WP theme, it has quite an advanced menu structure and i'm not quite sure how I can replicate it. The second menu item has a sub-menu, but it is not just a 'ul' inside a 'li', there are extra divs etc.. because the drop down has a 3 column layout with 2 columns containing the child links and the 3rd containing content.
This is an example:
<ul class="nav navbar-nav three">
<li class="dropdown yamm-fw"> <a href="#" class="dropdown-toggle">Parent Link</a>
<ul class="dropdown-menu">
<li>
<div class="yamm-content">
<div class="row">
<ul class="col-sm-6 col-md-3 list-unstyled two">
<li><a href="#"><i class="fa fa-map-marker"></i> Child Link 1</a></li>
<li><a href="#"><i class="fa fa-map-marker"></i> Child Link 2</a></li>
<li><a href="#"><i class="fa fa-map-marker"></i> Child Link 3</a></li>
<li><a href="#"><i class="fa fa-map-marker"></i> Child Link 4</a></li>
</ul>
<ul class="col-sm-6 col-md-3 list-unstyled two">
<li><a href="#"><i class="fa fa-map-marker"></i> Child Link 5</a></li>
<li><a href="#"><i class="fa fa-map-marker"></i> Child Link 6</a></li>
<li><a href="#"><i class="fa fa-map-marker"></i> Child Link 7</a></li>
<li><a href="#"><i class="fa fa-map-marker"></i> Child Link 8</a></li>
</ul>
<ul class="col-sm-6 col-md-6 list-unstyled two">
<li>
<h5>A title here</h5>
</li>
<li class="dart">
Some text here
</li>
</ul>
</div>
</div>
</li>
</ul>
</li>
</ul>
I have so far managed to figure out the classes and extra divs using the wp_nav_menu $args and a walker, here is what I have so far:
class Child_Wrap extends Walker_Nav_Menu
{
function start_lvl(&$output, $depth = 0, $args = array())
{
$indent = str_repeat("\t", $depth);
$output .= "\n$indent<ul class=\"dropdown-menu\"><li><div class=\"yamm-content\"><div class=\"row\">\n";
}
function end_lvl(&$output, $depth = 0, $args = array())
{
$indent = str_repeat("\t", $depth);
$output .= "$indent</div></div></li></ul>\n";
}
}
<?php wp_nav_menu(array( 'menu' => 'Header Nav', 'container' => false, 'menu_class' => 'nav navbar-nav three', 'walker' => new Child_Wrap())); ?>
But rather than having sub-links in the menus dashboard, is there a way of inserting a secondary menu to be the sub-menu, which can create the columns?
<?php wp_nav_menu(array( 'menu' => 'Submenu 1', 'container' => false, 'menu_class' => 'col-sm-6 col-md-3 list-unstyled two', 'link_before' => '<i class="fa fa-map-marker"></i> ')); ?>
Thanks