Closed neilberry001 closed 10 years ago
Add in suitable include. Adds current-menu-item to menu item for cpt's
current-menu-item
function current_type_nav_class($classes, $item) { $post_type = get_post_type(); $post_type_obj = get_post_type_object($post_type); if ($item->title == $post_type_obj->label) { array_push($classes, 'current-menu-item'); }; return $classes; } add_filter('nav_menu_css_class', 'current_type_nav_class', 10, 2 );
Add in suitable include. Adds
current-menu-item
to menu item for cpt's