I have a Multi-Level menu (with nested Sub-Menu) returned fom this PHP function:
wp_nav_menu( array(‘menu’ => ‘Category’ ));
I’d like to add a “first-level” class to each of first level and a “second-level” to each of seconnd level…and so on…
any help?
You don’t need to add your own classes because the HTML structure wp_nav_menu produces allows you to apply CSS to each level without the need for additional classes.
Here’s a link giving a walk through;
http://www.wpbeginner.com/wp-themes/how-to-style-wordpress-navigation-menus/
It has comments in the css that explains which levels the selectors are used for styling;