WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

There is the situation. I have created the custom post type - products withfuncionality like pages - I have to create hierarchy.


  1. Chairs:
    • Oak Chair
    • Nice Chair

The weird thing happens with wp_nav_menu(). When I open the first level page Chairs and display all the Chairs childrens in theme, the nav menu for the li item Products, gets the .current-menu-item class, but when I open the child page f.e. Oak Chair, the class disapears.

Why is that and how to set .current-menu-item class also when child page is opened?

This same problem happens again :( WP Version 3.2.1

the ancestor-class .current-products-ancestor is not setted up :(

share|improve this question
do you mean, that there is no .current-menu-item class on the child page? – Michael Aug 10 '11 at 11:10
Exactly. Only on parent page. – jam Aug 10 '11 at 11:21
Actully, wordpress gives tag .current-produkts-ancestor to menu element when child page is opened. This solves my problem, actually. I can then add different color to this menu item. – jam Aug 10 '11 at 12:24
This trick saves the world wordpress.stackexchange.com/questions/3014/… – jam Sep 28 '11 at 20:23
up vote 0 down vote accepted

Use this selector:


... to change the styles on that menu.

share|improve this answer
Yes, that is what i figured out. – jam Aug 11 '11 at 7:27

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.