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?


1 Answer 1


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*.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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