I've successfully added a class of 'is-active' to an active sidebar menu item. My issue is, this adds the class to the 'li' element, whereas I need to add it to the 'a' element. Any thoughts on how I can accomplish this?
Here is my code:
add_filter('nav_menu_css_class' , 'current_item_nav_class' , 10 , 2);
function current_item_nav_class($classes, $item){ if( in_array('current-menu-item', $classes) ){ $classes[] = 'is-active '; } retu $classes;
}