wp-bootstrap-navwalker icon indicating copy to clipboard operation
wp-bootstrap-navwalker copied to clipboard

Adding class='active' to parent and child current-menu-item

Open labanino opened this issue 12 years ago • 4 comments

Hello! I've been trying to get it to work like the image, parent and child submenu selected with no success. So far when I click any li ul li you have no idea where you are at unless you click the dropdown. It'd be nice to have the parent highlighted too. Any help? Thanks.

labanino avatar Mar 08 '14 16:03 labanino

There is an active class applied to the parent but it is not its not called active walker outputs the standard WordPress classnames. You should style current-post-parent. This is makes it extremely simple if you are using LESS to compile your CSS as you can actually reference a class name and its properties inside another class.

.current-post-parent > a {
     .navbar-nav > .active > a;
}

.current-post-parent > a:hover {
     .navbar-nav > .active > a:hover;
}

When you compile this it should automatically apply the bootstrap active styles to the .current-post-parent class.

SideQuestDIY avatar Mar 09 '14 16:03 SideQuestDIY

I got it to work. Thanks.

labanino avatar Mar 09 '14 17:03 labanino

Awesome! Glad everything worked out :)

SideQuestDIY avatar Mar 10 '14 14:03 SideQuestDIY

Hi i have the same Problem but i don't use the less file. what can i doo?

Blluefinger avatar Mar 19 '17 15:03 Blluefinger