WordPress Nav Walker to implement multilevel Bootstrap 4.0.0-beta navbars.
- PHP 5.4+
- WordPress 4.4+
Easy installation with Composer.
"repositories": [
{
"type": "vcs",
"url": "https://github.com/bccampus/wp-bootwalker"
}
],
"require": {
"bccampus/wp-bootwalker": "^1.0"
},
Update wp_nav_menu()
to use the BCcampus\BootWalker
walker. For example:
<?php
wp_nav_menu([
'theme_location' => 'primary_navigation',
'menu' => 'Primary Navigation',
'depth' => 3,
'container' => 'div',
'container_class' => 'collapse navbar-collapse',
'container_id' => 'navbarNav',
'menu_class' => 'navbar-nav mr-auto',
'fallback_cb' => '__return_empty_string',
'walker' => new \BCcampus\BootWalker()
]);
Bootstrap Navbar Documentation
You will want to modify the look and feel of the tier 3 'submenu'. Something like this will get you started.
.submenu{
background-color: grey;
padding-left: 1.70rem;
a{
font-size: smaller;
}
}
This has been modified from the original which is Copyright (c) 2017 Indigo Tree. Modifications are Copyright © Brad Payne and are released under the same MIT license.
The MIT License (MIT).