-1
==================================
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)?

1

1 Answer 1

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.

1

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.