I am creating custom Wordpress theme using a starter theme _Underscores. I am also using Bootstrap as a front-end framework.
I would like to modify wp_nav_menu so th
Just paste this code into functions.php file:
add_filter('nav_menu_css_class' , 'special_nav_class' , 10 , 2);
function special_nav_class ($classes, $item) {
if (in_array('current-menu-item', $classes) ){
$classes[] = 'active ';
}
return $classes;
}
More on wordpress.org: