Wordpress - How to manually specify the current active page with wp_nav_menu()
If you just want to add the current_page_item
class to one menu item, you could hook up to the nav_menu_css_class
filter, and add that class if needed. It is called when the menu is printed.
If you want access to the whole menu and add classes, hook in to the wp_get_nav_menu_items
filter, where you get the whole $items
array. You can edit the classes
properties of individual items.
@Jon
As long as you are using <body <?php body_class(); ?>>
WordPress will assign the class current_page_item
to your menu along with current_page_parent
if your using drop down menus.