Menu

Creating the WodPress menu to support Bootstrap 3.0+

It’s bit of a challenge to get the WordPress menu to working with your Bootstrap theme, this is where wp_bootstrap_navwalker come handy.

First things first, download the navwalker.php from GitHub, and include it in your functions.php.

require_once(get_template_directory() . '/includes/navwalker.php');

And use it like this

 wp_nav_menu(array(
    'menu'              => $menu,
    'theme_location'    => 'primary',
    'depth'             => 3,
    'container'         => 'nav' ,
    'container_class'   => 'nav',
    'menu_class'        => '',
	'link_before'       => '<span>',
	'link_after'        => '</span>',	
    'fallback_cb'       => 'wp_bootstrap_navwalker::fallback',
    'walker'            => new wp_bootstrap_navwalker()
  ));

its that easy.

Leave a comment