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

Clickable parent #26

Open Lasse-Niller opened 2 years ago

Lasse-Niller commented 2 years ago

Is i possible to make the parent stay clickable when having children items?

damiansonek commented 2 years ago

My solution is:

Replace $attributes .= ( $args->walker->has_children ) ? ' class="'. $nav_link_class . $active_class . ' dropdown-toggle" data-bs-toggle="dropdown" aria-haspopup="true" aria-expanded="false"' : ' class="'. $nav_link_class . $active_class . '"';

to $attributes .= ( $args->walker->has_children ) ? ' class="'. $nav_link_class . $active_class . '" aria-haspopup="true" aria-expanded="false"' : ' class="'. $nav_link_class . $active_class . '"';

and triggering dropdown by css: .menu-item-has-children:hover { .dropdown-menu { display:block !important; } }

However, take into account that I do not use navbar for the mobile version (I have my own) and I don't know how it will work.