Wrap divs around wp_nav_menu

7 months ago 27

I and gathering a customized responsive paper and americium having occupation integrating my customized mobile paper functionality. I person this codification for the desktop menu:

<div class="d-none d-sm-none d-md-block"> <?php wp_nav_menu( array( 'theme_location' => 'primary', 'container_class' => 'collapse navbar-collapse', 'container_id' => 'navbarNavDropdown', 'menu_class' => 'navbar-nav ml-auto', 'fallback_cb' => '', 'menu_id' => 'main-menu', 'depth' => 2, 'walker' => caller Understrap_WP_Bootstrap_Navwalker(), ) ); ?> </div><!-- extremity d-none etc --> <!-- extremity desktop paper -->

This works great, nevertheless erstwhile I tried to incorporated this to my mobile menu, I'm incapable to integrate the div operation that provides my mobile functionality. How bash I integrate this codification into my wp_nav_menu array?

note: this works good connected its own, but I'm incapable to get the sub nav tabs in, hence wherefore I privation to usage nav walker.

<div id="mySidenav" class="sidenav"> <ul id="menu"> <a href="javascript:void(0)" class="closebtn" onclick="closeNav()">&times;</a> <?php $nav_links = wp_get_nav_menu_items('main-menu'); ?> <?php if ($nav_links): ?> <ul> <?php foreach ($nav_links arsenic $link): ?> <li> <a href="<?php echo $link->url; ?>"><?php echo $link->title; ?></a> </li> <?php endforeach; ?> </ul> <?php endif; ?> </ul> </div><!-- extremity broadside nav -->
Read Entire Article

Our Ventures