add_li_class
isn’t valid arg for wp_nav_menu
Try this in your functions.php
add_filter( 'nav_menu_css_class', 'add_my_class_to_nav_menu', 10, 2 );
function add_my_class_to_nav_menu( $classes, $item ){
$classes[] = 'menu-dropdown';
return $classes;
}
Related Posts:
- Multi Level Bootstrap Navigation Menu in WordPress
- Show only 2nd level of navigation depending on active navigation
- Custom Nav Walker sub-menu HTML construct
- Adding different classes to anchor in navigation menu
- how to automatically generate hierarchical menus from hierarchy of pages?
- How to display dynamic content in start_lvl function
- Menus like a CMS
- How to have custom menu Item CSS Classes for wp_page_menu() or wp_list_pages()
- How to add a submenu toggle button inside all “li” elements that have a submenu?
- Check if menu id = $specific_id – then insert specific
- wp_nav_menu() with multiple Class
- Trying to Create Menu in WordPress
- How do I add recent posts to the menu?
- Automatically list top level menu item child pages
- Check if menu_item has children or has parent
- Add a submenu to wp_nav_menu
- How to buid wordpress menu with auto width sub-menu items in dropdown menu without any items sharing one line [closed]
- Adding toggle-able element after menu item
- How to Add support for sub-menu item description in wordpress?
- wp_nav_menu container style args
- Bootstrap Theme Migrated to WordPress
- WordPress + Bootstrap: Replace primary navigation menu on mobile?
- How can I click the parent menu then redirect to a special URL?
- Creating navigation out of specific IDs and their children?
- Where to place a svg chevron down in my custom walker?
- Add href to tag in nav menu for mobile
- Conditional Nav Menu Inside Nav Menu Across Multisite Sites
- Show Child of Parent Page including all other parents
- nav_menu: how to force a subpage switching on the parent menu
- How was this menu system created?
- Display sub menus as separate lists
- Give custom class names to WP nav sub-menu
- Split up wp_nav_menu with custom walker
- How to Add to Each Menu Link with link text to data-attr?
- how to create a menu with all sub categories?
- Add a .last class to the last in each ul.sub-menu
- Bootstrap dropdown nav pills not working with wp_nav_menu()
- How to move parent li to end of child ul
- wp_nav_menu() loses ‘current-menu-*’ classes on single product page within category
- How to make pages metabox display all hierarchy in menu admin?
- Bar separated navigation by extending Walker_Page
- Custom Walker for Walker_Nav_Menu
- Add class to menu ul with active child
- Make compatible custom menu widget for Twitter Bootstrap
- Disable automatig SVG tag from menu
- Replace menu permalink/hyperlink with only menu name/slug
- wp_nav_menu add some element to container
- next_post_link() on custom menu structure
- Find out if a page has no parent
- Prev / Next menu item
- How to include a third level with wp_get_nav_menu_items function
- Schedule Page to Menu [duplicate]
- Can’t include Language switch in Nav Menu
- Add within the output of
- Grey out nav buttons unless is_user_logged_in()
- How to approach this menu design?
- Reuse a custom WordPress menu on another WordPress website
- How to dynamically populate a dropdown
- Hierarchical menu nesting problem with jQuery targetting
- Is this format possible with a custom Nav Walker class?
- two different separate sections on the same site
- Add code to WordPress menu items by class
- How do you add a around the second level of a Menu?
- How to customize submenus isn wordpress theme [closed]
- Can I have a different menu for each parent page?
- How Do I Add Images To Main Navigation Menu
- Walker menu not displaying at all
- Wrap list parent in div with wp_nav_menu menu
- Hide menu from homepage
- How to automatically redirect to first item of second navigation level in a multi-level menu?
- Locking in navigation labels before changing title?
- How to add columns to wordpress menu editor
- how to insert data in li tag of navigation
- Current author archive in navigation menu
- Output Post ID for all nav_items
- Add menu headings to WordPress sub menus
- Custom ul class
- Removing Submenu from Menu
- How to create menu spread over four lines including images
- Help with WordPress Custom Nav Walker
- Hide a menu (navigation bar) on all posts
- How to add all subcategories as submenu in WordPress menu
- What is inside in $item in start_el function in Walker_Nav_Menu class
- Bootstrap Nav Walker Sub Menu Image
- Add active class to wp_nav_menu
- Disable Top Nav Bar on Mobile
- Product categories are mixed when creating menu
- how to configure this type of menu
- Header lists posts instead of showing primary nav menu
- How to separate sub-menu output and keep associated with parent
- Programmatically add a Navigation menu and menu items
- Show only second level menu items? [duplicate]
- Add item ONLY to the primairy navigation
- Image menu on responsive WordPress
- wp_nav_menu: indicate by id page grandparents
- individual images as navigation design TwentyTen
- WordPress Navigation default output
- Adding Sub Menu In a theme which Do not have Menu Options
- Add a navigation menu item using MySQL
- Custom navigation / menu output (walker?)