Skip to content

Instantly share code, notes, and snippets.

@dededey
Created March 31, 2015 09:17
Show Gist options
  • Save dededey/57d3b0b562c809a603b4 to your computer and use it in GitHub Desktop.
Save dededey/57d3b0b562c809a603b4 to your computer and use it in GitHub Desktop.
add active in menu
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;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment