It's a bit difficult to express my problem : I have a navigation menu of 2 levels
A B
|----| |----|
| A1 | | B1 |
| A2 | | .. |
|----| |----|
A,B are two empty links, A1,A2,B1 are pages. In A1, there's a link that redirects to another page C.
I have such CSS code to highlight the current menu item:
.current-menu-ancestor, .current-menu-parent,
.nav-menu > .current-menu-item {
padding-top : 15px;
text-decoration: underline;
}
When I browse the pages A1,A2,B1, it works well. But when I browse the page C, no menu item is shown as "current page item".
I got a walk-around which is to add the page C into the menu as a sub-menu of A1, then I "hide" this sub-menu with a personalized CSS class
.hidden-sub-menu {
display : none !important;
}
As I have a lot of sub-menu items to manage, I don't think this walk-around is a good way. Maybe I need to modify certain files while the generation of html page. But I don't know which files and how.
Any proposition is welcome. Thanks in advance!