Stars: 222
Forks: 95
Pull Requests: 3
Issues: 27
Watchers: 10
Last Updated: 2022-04-02 06:59:45
Bootstrap 5 WordPress navbar walker menu.
License: MIT License
Languages: PHP
https://github.com/AlexWebLab/bootstrap-5-wordpress-navbar-walker
bootstrap-5-wordpress-navbar-walker
register_nav_menu('main-menu', 'Main menu');
<nav class="navbar navbar-expand-md navbar-light bg-light">
<div class="container-fluid">
<a class="navbar-brand" href="#">Navbar</a>
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#main-menu" aria-controls="main-menu" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="main-menu">
<?php
wp_nav_menu(array(
'theme_location' => 'main-menu',
'container' => false,
'menu_class' => '',
'fallback_cb' => '__return_false',
'items_wrap' => '<ul id="%1$s" class="navbar-nav me-auto mb-2 mb-md-0 %2$s">%3$s</ul>',
'depth' => 2,
'walker' => new bootstrap_5_wp_nav_menu_walker()
));
?>
</div>
</div>
</nav>
Here is how it works: