php – Add class to ul and li in wp_na

Question

I want to add class to ul and li using wp_nav_menu , I have checked documentation and I found this :

wp_nav_menu(array('theme_location'=>'primary','menu_class'=>'navbar-nav'));

but the class is showing on div instead of ul , do anyone has an idea how to add class to ul and li
I have added also this code to functions.php

function wpb_custom_new_menu() {
    register_nav_menu('primary',__( 'Main Menu' ));
}
add_action( 'init', 'wpb_custom_new_menu' );

Please note that I am using Underscores Starter theme
Thanks in advance

0
Ahmed C 2 weeks 2022-07-27T14:34:56-05:00 0 Answers 0 views 0

Leave an answer

Browse
Browse