A custom WordPress nav walker class to fully implement the Twitter Bootstrap 4.0+ navigation style (v3-branch available for Bootstrap 3) in a custom theme using the WordPress built in menu manager.
Rolls a number of small fixes in, no major changes.
#
values on the dropdown src
instead of empty stringThis is the final release (with exception to minor tweaks) for the Bootstrap 3 version of this walker. It's unlikely to receive many updates going forward.
Here is a list of the most notable changes between the Bootstrap 3 version and the Bootstrap 4 version:
Code tested and updated using WP Enforcer & Code Climate to better meet WordPress PHP Standards.
This release offers full support for managing Bootstrap 3.0 menus through the WordPress menu manager and supports, glyphicons, dividers, nav headers & disables links. Now with a graceful fallback function.
Changes in this release
wp_nav_menu
Tested With
Upgrade Notes
In order to use the custom fallback function you must update your fallback_cb
attribute in your wp_nav_menu
declaration.
<?php
wp_nav_menu( array(
'menu' => 'primary',
'theme_location' => 'primary',
'depth' => 2,
'container' => 'div',
'container_class' => 'collapse navbar-collapse navbar-ex1-collapse',
'menu_class' => 'nav navbar-nav',
//New fallback_cb attribute
'fallback_cb' => 'wp_bootstrap_navwalker::fallback',
'walker' => new wp_bootstrap_navwalker())
);
?>