add_filter('nav_menu_css_class' , 'special_nav_class' , 10 , 2);
function special_nav_class ($classes, $item) {
if( in_array('current-menu-item', $classes) || in_array('current-menu-parent', $classes) ){
$classes[] = 'active';
}
return $classes;
}
Be the first to comment
You can use [html][/html], [css][/css], [php][/php] and more to embed the code. Urls are automatically hyperlinked. Line breaks and paragraphs are automatically generated.