This should add the drop class to all the li elements in the menu and also add your classes to the wrapping ul:
function wpse_232637_add_menu_parent_class( $items ) {
foreach ( $items as $item ) {
$item->classes[] = 'drop';
}
return $items;
}
add_filter( 'wp_nav_menu_objects', 'wp_232637_add_menu_parent_class' );
$args = array(
'menu'=>'',
'menu_class'=>'nav navbar-nav navbar-right',
'menu_id'=>'',
'container'=>false,
'container_class'=>'',
'container_id'=>'',
);
wp_nav_menu($args);
Rather than having to strip back all the output of wp_nav_menu
to use your own ul
and li
elements, this should add the classes you want to WP’s generated ul
and li
elements.