0

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!

panda
  • 73
  • 1
  • 1
  • 6
  • When you access A1, it `redirects` or the user clicks a link? – Michael Lewis Jan 08 '14 at 01:49
  • A1 is a sub-menu item, it's a page as well. In this page, I have a link link. When I browse C by clicking on this link, the menu item A is no longer "current-menu-ancestor". So user needs to click the link. – panda Jan 08 '14 at 14:47

0 Answers0