Return to Snippet

Revision: 37791
at December 17, 2010 04:18 by wpCanyon


Initial Code
add_filter( 'nav_menu_css_class', 'additional_active_item_classes', 10, 2 );

function additional_active_item_classes($classes = array(), $menu_item = false){

	if(in_array('current-menu-item', $menu_item->classes)){
		$classes[] = 'active';
	}

	return $classes;
}

Initial URL
http://wpcanyon.com/tipsandtricks/adding-classes-to-the-current-page-item-in-wp_nav_menu/

Initial Description

                                

Initial Title
Adding Classes to the Current Page Item in wp_nav_menu()

Initial Tags
wordpress

Initial Language
PHP