There are two ways of doing this:
-
Javascript. You could use JQuery to select the
<li>that have<ul>children of class ‘sub-menu’, inserting content, or appending a CSS class which you then style. For example:$('.sub-menu').parent().addClass('myclass') -
PHP, a new walker function. Copy the code from wp-includes/nav-menu-template.php (until approx line 109) into your themes functions.php to create a new walker. Pass this walker as an argument to your menu call. In the modified Walker insert a
<span>for an arrow on a sub-menu level item.function start_lvl(&$output, $depth) { $indent = str_repeat("\t", $depth); $output .= "\n$indent<span class=\"right-arrow\">→</span><ul class=\"sub-menu\">\n"; }This will add a small arrow that you can then style just before the sub-menu list item.
Related Posts:
- Split up wp_nav_menu with custom walker
- Custom Nav walker display current menu item children, or siblings on no children
- Add a custom walker to a menu created in a widget
- Using a menu walker add a custom item at the end of the menu’s items
- Error “Trying to get property of non-object” with Custom Walker for wp_nav_menu
- How to count nav menu items?
- How Does The Walker Class Work?
- Add Javascript to WordPress Menu
- Does Extending Multiple Nav_Menu_Walkers Allow Nested Menus?
- How does a minimal menu walker look like?
- Display only page specific sub menu items using Custom Walker
- WordPress Menu Custom Walker Class
- How to create this custom menu walker?
- Hook or callback when wp_nav_menu() has completed
- How do I add 3rd level of dropdowns to wp_nav_menu array?
- Add attributes to wrapper html generated by wp_nav_menu
- How to include second layer sub menu to Walker Nav?
- Event listener callback returns undefined element
- Help with WordPress Custom Nav Walker
- Why is my navigation in my onepage not working?
- url_to_postid method in walker_nav navigation menu causing exceptionally high TTFB
- Mobile navigation javascript problem
- Cannot collapse a responsive menu in WordPress
- Is it possible to get_the_post_thumbnail (Featured Image) inside a sprintf function?
- How can I creat custom menu with bootstrap
- Change hover to onclick on menu
- WordPress menu walker – help to add custom class for each submenu
- Need help with Walker_Nav_Menu class
- Structuring Nav Menu and Background Custom page (Help)
- Can I now add a class in the anchor of my menu item with WordPress 5.4?
- why are my walker menu is showing like this?
- Add “onclick” option to header menu item
- Stuck while adding bootstrap navwalker class
- What is inside in $item in start_el function in Walker_Nav_Menu class
- Multi-Level Nav Bar
- Adding additional html to the end of the root level in a custom nav walker
- Does the Default theme of WordPress like 2016, 2017 and 2019 uses Walker_Nav_Menu Class
- wordpress custom menu – show parents, siblings, children depending on depth
- Nav_walker add id to dropdown ul
- Homepage Menu Link Won’t Function
- How to create a mobile menu full screen overlay using Understraps Bootstrap 4 theme
- Change markup for just 2nd list element in custom Walker menu
- Menu walker: how to tell if a sub menu contains submenus?
- Where to place a svg chevron down in my custom walker?
- WordPress customizing a walker menu class
- Add active class to wp_nav_menu
- calling JS to custom menu design
- javascript i wrote not working, can’t figure out why [closed]
- Output existing wp_nav_menu with a custom walker
- How to remove a sub-menu using walker hooks/filters without relying on a custom walker?
- how to split vertical menu into two columns using walker nav menu
- how do you create this customize menu using wp_nav_menu function?
- Classes CSS (Optional) – how do I reference this in php?
- Extending Walker_Nav_Menu in wp_nav_menu List of Empty Items
- Parent link need to go first child submenu
- Displaying a part of a menu containing the page the user is currently viewing and only it’s immediate children
- Custom wordpress submenu
- Walker or wp_get_nav_menu_items VS jQuery
- WPML CMS Nav and Custom Nav_Walker Undefined Property Notices [closed]
- How can I make menu items into two seperate buttons with different functions?
- Conditional Nav Menu Inside Nav Menu Across Multisite Sites
- How to add odd and even classes to all nav links through walker?
- Output sort number in wp menu list item?
- Custom menu with Walker class – what should the $db_fields be?
- Cannot add home page url to menu with #
- Show post titles within WordPress bootstrap Dropdown menu
- Menu Details Output in Javascript [closed]
- Add parent link to its submenu
- Is it possible to separate all submenu items?
- Creating custom Menu for custom theme
- Check in walker if current page is descendant
- Count Level 1 Childs for Custom Nav Walker WordPress
- How can I edit submenu headings using wp_nav_menu walker?
- Specific Page that convert Hyperlink to anchor in nav menu
- Can’t add optional class to menu item when using Walker_Nav_Menu
- Add dynamic content block to nav section generated by custom walker
- Showing a link with Javascript based on log-in status
- Customize Walker_nav_menu to show posts if item is category
- Need direction on a seemingly complex menu walker for automatically inserting a parent link li in it’s submenu ul
- How do i keep my current page menu highlighted on pagination?
- Additional class for.sub-menu UL?
- How can I modify wp_nav_menu with walker?
- Determine if a navigation item has children
- Walker for menus
- Use wp_nav_menu to dynamically generate child menus
- wp_nav_menu – Collapse with PHP
- custom walker to add iconfont to wp_nav_menu
- how to make a walker to this (in bootstrap, i try but not work)
- Broken drop down menu using Bootstrap and navwalker class
- how can i get the page_ID in nav li [closed]
- Jquery dropdown menus working locally, but not in WordPress [duplicate]
- Changing when mobile menu is displayed
- Custom navigation / menu output (walker?)
- Using walker to display all menu branches at once?
- How can I only show one responsive menu on mobile devices?
- Active Navigation Class Based on URL on icon
- WordPress nav Walker – Bootstrap 5.2.3 – submenu not opening
- Nav walker bootstrap: Display 3rd level and 4th level in dropdown menu
- Override theme hamburger menu to work without javascript (noscript)
- Remove WordPress Menu Classes and ID with Bootstrap Walker