Sign up ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.
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… –  Cynial Jul 25 '11 at 9:55

1 Answer 1

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.… –  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.