Create a gist now

Instantly share code, notes, and snippets.

Embed
Wordpress Navigation menu Dynamic With dropdown Support
//Must be included walker menu from wp-bootstrap-navwalker.php on github
register_nav_menus(array(
'header_menu' => 'Header Menu',
'footer_menu' => 'Footer Menu'
));
<?php
wp_nav_menu(array(
'theme_location' => 'header_menu',
'container' => 'div',
'container_class' => 'navbar-collapse collapse align-left',
'menu_class' => 'nav navbar-nav',
'depth' => '3',
'fallback_cb' => 'WP_Bootstrap_Navwalker::fallback',
'walker' => new WP_Bootstrap_Navwalker()
));
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment