Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add active class to dropdown menu items for current page #431

Open
914digital opened this issue Jul 23, 2019 · 2 comments · May be fixed by #530
Open

Add active class to dropdown menu items for current page #431

914digital opened this issue Jul 23, 2019 · 2 comments · May be fixed by #530
Labels
[TYPE] BUG An issue reporting a bug

Comments

@914digital
Copy link

Hey. Thanks for Navwalker. It is a god send. So my issue:

With the release of the new Bootstrap 4, the dropdowns don't have an li class for current_page_item like on parent items. Is there any way to add an active class to a submenu item on click? I've messed around with some jQuery. The issue: If the page is refreshed, it loses the active class.

Again, thanks for making this available to everyone.

@LukaszJaro
Copy link

The dropdowns do have have the active class:

image

This is a demo website using bootstrap 4 and the custom bootstrap navwalker:

https://understrap.com/understrap/?page_id=733

Make sure you're actually using the custom navwalker:

'walker' => new WP_Bootstrap_Navwalker(),

@IanDelMar IanDelMar added the [TYPE] BUG An issue reporting a bug label Jan 30, 2021
@IanDelMar
Copy link
Collaborator

Note: Still a bug.

Bootstrap provides CSS for .dropdown-item.active but not for .active .dropdown-item. The Walker sets the active class on the <li> instead of the <a> leading to .active .dropdown-item.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[TYPE] BUG An issue reporting a bug
Projects
None yet
3 participants