This is relatively easily done with a filter.
function alter_menu_class_wpse_113022($args) {
// var_dump($args); // debug
$args['menu_class'] = 'my-nav-menu';
return $args;
}
add_filter('wp_nav_menu_args','alter_menu_class_wpse_113022');
That will make this line:
<ul id="menu-scroll" class="nav-menu">
Look like this one:
<ul id="menu-scroll" class="my-nav-menu">
But that could cause themes to break horribly. If a theme has used that class to apply styles to the menu, which would be a reasonable thing to do, you’ve just broken all of that styling. The effected menus will look terrible and may not even function. This is a very, very bad idea. Please don’t do it.
Related Posts:
- Split up wp_nav_menu with custom walker
- 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
- Automatically generated menu
- Variables within wp_nav_menu
- Prev / Next menu item
- 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
- Filter for Admin Nav Menus Drop Down
- 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
- 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?
- remove class “sub-menu” from wordpress drop down menu
- 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?
- Change Menu Button Text [closed]
- 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 open a lightbox form from a navigation menu item
- 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)
- 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?
- Creating navigation out of specific IDs and their children?
- 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
- Add acf custom fields so sub item in menus