bootstrap-5-wordpress-navbar-walker icon indicating copy to clipboard operation
bootstrap-5-wordpress-navbar-walker copied to clipboard

Clickable parent

Open Lasse-Niller opened this issue 3 years ago • 1 comments

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

Lasse-Niller avatar Apr 15 '22 14:04 Lasse-Niller

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.

damiansonek avatar May 06 '22 08:05 damiansonek