AlexWebLab / bootstrap-5-wordpress-navbar-walker

Bootstrap 5 WordPress navbar walker menu.
https://github.com/AlexWebLab/bootstrap-5-wordpress-navbar-walker
MIT License
250 stars 107 forks source link

bootstrap-5-wordpress-navbar-walker - is there any support for multilevel menu #27

Closed Mrinmaybiswas closed 2 years ago

Mrinmaybiswas commented 2 years ago

Hi @AlexWebLab ,

Thank you for this code. I have implement this code working fine for singe dropdown but when I try to do this multilevel on that time menu ul not generating. Can you help me on this.

image image

Mrinmaybiswas commented 2 years ago

https://codepen.io/typo3-freelancer/pen/poEvyGj

Here is the support of bootstrap multilevel menu.

Mrinmaybiswas commented 2 years ago

Hi @AlexWebLab @AlexWebLab @justinkruit

Hi have fixed this issue here is the code for clear understanding.

` //use on menu section

$args = array( 'theme_location' => 'header-menu', 'container' => false, 'menu_class' => '', 'depth' => 0, 'fallback_cb' => 'bootstrap_5_wp_nav_menu_walker::fallback', 'items_wrap' => '

', 'walker' => new bootstrap_5_wp_nav_menu_walker() );

// use function.php

// bootstrap 5 wp_nav_menu walker class bootstrap_5_wp_nav_menu_walker extends Walker_Nav_menu { private $current_item; private $dropdown_menu_alignment_values = [ 'dropdown-menu-start', 'dropdown-menu-end', 'dropdown-menu-sm-start', 'dropdown-menu-sm-end', 'dropdown-menu-md-start', 'dropdown-menu-md-end', 'dropdown-menu-lg-start', 'dropdown-menu-lg-end', 'dropdown-menu-xl-start', 'dropdown-menu-xl-end', 'dropdown-menu-xxl-start', 'dropdown-menu-xxl-end' ];

/**

} // register a new menu register_nav_menu('Header Menu', 'header-menu');`

image