Skip to content

Instantly share code, notes, and snippets.

@anthonybudd
Created February 20, 2017 11:06
Show Gist options
  • Select an option

  • Save anthonybudd/55830169a534456ecdb6804efe5d9028 to your computer and use it in GitHub Desktop.

Select an option

Save anthonybudd/55830169a534456ecdb6804efe5d9028 to your computer and use it in GitHub Desktop.
<?php
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