You can either use a filter in your functions.php file:
function mytheme_nav_menu_css_class($classes, $item, $args) {
if($args->theme_location == 'secondary') {
$classes[] = 'your-class-name';
}
return $classes;
}
add_filter('nav_menu_css_class','mytheme_nav_menu_css_class');
Or if you go to your WP Admin, click Appearance -> Menus and then click the tab at the top “Screen Options”, you can tick CSS Classes
which will enable you to add a class to each list item in your menu.
See this article for details.
Related Posts:
- New post notification in wp_nav_menu
- WordPress Menu Custom Walker Class
- How to change order of menu items
- How to use a WordPress’ existing admin icon?
- Add Commas Between Menu Items?
- Show child pages by menu order using Superfish Dropdown menu?
- Bootstrap drop down menu with wp_nav_menu
- One site, 2 distinct sections: two different top nav menus?
- Can you have different menus and theme on a per-page basis?
- Adding a within ‘s from wp_nav_menu()
- Display link with current user’s username in it in Custom Menu
- Add class to menu ul with active child
- jQuery cookie not working properly in wordpress
- Make compatible custom menu widget for Twitter Bootstrap
- Check what “type” a menu item is
- Automatically generated menu
- Variables within wp_nav_menu
- Admin only menu/page
- wp_update_nav_menu_item not saving in multisite API
- Header style different on home and remaining pages
- add span class and i tag inside wp_nav_menu link anchor tag
- Hide sub menus sometimes
- is_page() not working with archives?
- How to Overwrite/Customize wp-admin/nav-menus.php in WordPress
- Grey out nav buttons unless is_user_logged_in()
- Add a class at specific element in custom Menu Walker
- burger on mobile
- How to approach this menu design?
- Trying to Create Menu in WordPress
- Hierarchical menu nesting problem with jQuery targetting
- ‘Users’ and ‘Appearance’ have disappeared from dashboard menu [closed]
- Making nav menu sticky and transparent
- Jupiter theme Mega menu option not available
- Sub Menu does not display using Nav Walker
- Get Menu Name inside walker
- How to add ul and li classes to nav in wordpress
- Cant add menu items with my theme
- Why aren’t my post showing under my custom menu?
- Where to implement custom walker class?
- Responsive menu gone on wordpress Responsive theme
- Dynamically add sub menu items
- Creating a Mega Menu
- register_nav_menus() won’t register menus
- How can I add text to a single nav menu item?
- Alternative to wp_get_nav_menu_items?
- How to add attribute in menu code
- In the Admin Dashboard, can I choose which sections to display?
- How to change the color of a menu item [closed]
- Walker menu not displaying at all
- Twenty seventeen Menu is not responsive not clickble
- wp_nav_menu not displaying the right way
- How to set classname for tag in wordpress menu?
- add 3rd party link (with script) to menu item
- Limit wp_nav_menu_objects() only to first-level menu items
- wp_get_archives doesn’t take effect from css or html
- Hide an item from a menu to some users
- Locking in navigation labels before changing title?
- How to Add support for sub-menu item description in wordpress?
- wp_nav_menu_items for one menu
- Customise the custom menu widget
- I can’t add more pages to menu – menu delete pages
- Confused about the correct functioning on WordPress Menus
- Admin Menu Hack (Left side in Dashboard)
- How to manipulate attributes of url-less dropdown item in a the custom wordpress menu?
- How do I remove this menu bar?
- Hide custom menu when when no menu selected
- nav-menu-template and columns in sub menu
- Auto delete menu items with zero products (woocommerce)
- current-menu-item not apllying with wp_nav_menu() on ajax
- Custom link with checkbox that adds additional word to checked menu items
- menu not showing on mobile view
- Why is my navigation in my onepage not working?
- Admin menu in different languages
- Edited one page in my working menu and now all menu buttons don’t open unless I right-click and open in new tab
- Need help with Walker_Nav_Menu class
- Impossible to remove page from menu
- why are my walker menu is showing like this?
- Is it possible to have submenu outside of menu element? I dont want submenu to be a child of menu
- Menu with sub-items but without link
- Bootstrap Nav Walker Sub Menu Image
- What are some of your favorite methods for creating an accessible menu?
- Add active class to wp_nav_menu
- How to get all the menu listed in Menus Created inside the Apperance Menu?
- how to configure this type of menu
- Migrate WP Menu between sites
- Add Class to Custom Menu Widget ul
- Add parent link to its submenu
- Can’t change link for navigation item
- Show Child of Parent Page including all other parents
- Loading wordpress menu in an external server
- Need direction on a seemingly complex menu walker for automatically inserting a parent link li in it’s submenu ul
- Show only second level menu items? [duplicate]
- Add item ONLY to the primairy navigation
- wp_nav_menu in 3.7 add name class nav navbar-nav
- Prevent Menu Shortcode From Formatting
- individual images as navigation design TwentyTen
- Is there a limit to number of pages displayed for selection in custom menu?
- Add monthly archives menu and submenu
- Database structure Menu Item
- I need to change the hyperlink attached to the logo on the mobile menu