WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

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

I'm using the new custom menus in my side navigation and it only creates a class sub-menu in the UL's but does not use the current_page_item like when you use wp_list_pages(). I have 3 levels and only want to show the sub menus of the page you are on, easily done using wp_list_pages() but I can't do it with the custom menus?

Can someone please help?


share|improve this question

The current-item CSS class generated by wp_nav_menu() is .current-menu-item. However, wp_nav_menu() also has backward-compatibility with wp_page_menu()/wp_list_pages(), and does output .current_page_item (if the current context is a page post-type, of course).

So, a couple of possibilities:

  1. The current context is not a static Page
  2. You're using a custom walker for the wp_nav_menu() output, that doesn't output a CSS class for .current*.
share|improve this answer

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.