I have this code in my header.php and its working properly except showing li's without menu-item class, its showing them with page-item instead. this is when i dont have a menu created from admin and assigned it to a menu location.
So the menu is wordpress default menu which shows all the pages added. Is there a way to add menu item class with them.
I tried following code but its not working.
function li_nav_class($classes, $item, $args){
$classes[] = 'menu-item ';
return $classes;
}
add_filter('nav_menu_css_class' , 'li_nav_class' , 1 , 3);