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
Home Contact About

For example, The menu should looks like

Home Contact About

when the URL is http://loaclhost/contact/XXXXXXXX, the same as other.

How to do this? It seems can use nav_menu_css_class by add_filter, but the key is how to judgment the current menu is contact (or other)?

share|improve this question
I have found the perfect solution. If anybody has the same issue, please go to rarescosma.com/2010/11/… – Cynial Jul 25 '11 at 9:55

If you're using WordPress custom menus ( and you should when you're dealing with menus ), it adds class current-menu-item for page that is currently being viewed.

share|improve this answer
Thanks answer. I just found a perfect solution about it. For sharing. rarescosma.com/2010/11/… – Cynial Jul 25 '11 at 9:54

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.