Try this:
function custom_walker_nav_menu_start_el($item_output, $item, $depth, $args){
$output="<div class="buttons-".$item->ID.'" title="some_title">';
$output .= $item_output;
$output .= '</div>';
return $output;
}
add_filter( 'walker_nav_menu_start_el', 'custom_walker_nav_menu_start_el' , 10, 4 );
This uses walker_nav_menu_start_el
filter to add custom content before and after the link item. ID
is appended to buttons-
. If you need this customization for only specific menu then you can check $args
as your requirement.
Related Posts:
- Removing container from wp_nav_menu not working
- Using a menu walker add a custom item at the end of the menu’s items
- Add settings to menu items in the Customizer
- WordPress Shortcode in Menu Item Title
- Show current navigation path from menu
- Menu items (all menus) being deleted randomly on their own [duplicate]
- How do I fix this error: Warning: invalid argument supplied for foreach()?
- Exclude one item from wp_list_pages( $args );
- Put a wp_nav_menu inside another one
- different Menu position showing same menu
- How to add bubble count in WordPress wp_nav_menu menu?
- Add class to active top level (grandparent) menu item
- WordPress wp_nav_menu within iFrame
- Check if wp_nav_menu items have submenus
- wp_nav_menu doesn’t generate parent/ancestor classes
- Extend WordPress REST API to show slugs for menu items
- WP_nav_menu fallback not working
- Output menu navigation in php file
- Custom Post type menu highlighted in the archive/post
- How to conditionally register nav menus with advanced custom fields?
- Use walker for specific menu, or avoid use of walker
- Change where navigation bar links?
- Sort wp_nav_menu() by menu order
- How to have custom menu Item CSS Classes for wp_page_menu() or wp_list_pages()
- How to give custom classes to the WordPress Menu widget
- No “current-menu-ancestor” class added when browsing an archive page
- Does wp_nav_menu use the gettext filter?
- How to add #navbar to all page links?
- Problems Displaying Multiple WP Menus
- View h2 content tags of a page in sub menu
- How to add custom classes to more than one separate menu’s a link in wordpress?
- Change an li class name in a wordpress custom menu walker
- Custom walker nav – Add sequential number as class
- Separator for custom nav menu
- add_submenu_page function to show videos table
- Menu item with no page, but with dropdown
- How to test if blog page is active
- WordPress Custom Menus Issue
- Side Menu Icon Expandable
- wordpress responsive menu not dropping down
- WordPress Plugin menu position overwrite other item
- Two different “Home” items in custom menus dashboard section
- How to use a start_el variable in start_lvl
- Need Random Category Nav Menu
- Using _s theme, menu changes do not affect header menu
- Change class-name on “current_ancestor” in wp_nav_menu
- edit user menu item
- Excluding a media query from specific pages
- Use dashicons in menu items?
- Menu Arrow for Child Element
- Custom menu with different behavior for every item
- Responsive dropdown menu with smaller screen sizes
- Problem in applying active class to wordpress menu
- How to get submenu dropdown with images?
- Walker Class: Output Parent Description and Featured Image right after sub-menu?
- Modifying the walker to insert parent’s description above sub menus
- wp_list_pages Hierarchical Help
- How to avoid the and which added when custon menu widget is used
- How to create a complete mulilanguage site using xili language plugin?
- An alternative to WordPress’s built-in menu functionality
- Is there any way to change the CSS class applied to 2nd level sub menu ul’s?
- pre_get_posts fix to show menu on CPT Archives broken WP 6.0
- WordPress Menu Problem
- Problem with links once in portfolio item
- How to link current logged-in user to their author page via URL (Beginner)
- Top bar menus not showing on mobile
- Add Different Class on Different Ul in twenty-twentyone theme
- How to create a link-less parent (top level) menu item that doesn’t use an anchor tag
- Get Each Menu Nav Label of Menus in HTML tag
- How to swap text in menu item back and forth?
- WordPress menu issue – if there are child links partents won’t click
- Need Help Regarding Menu Magement in admin
- And I click on a menu item and it leads me to nowhere
- WordPress menu issue after update
- Show thumbnail to category items in wp_nav_menu(), how?
- Conditional Nav Menu Inside Nav Menu Across Multisite Sites
- Menu’s built in the edit theme view do not have active states set when on child pages
- Menu Responsive
- How to create menu in Word Press 4.2.2?
- Custom menu creation
- Adding class atribute to wp_nav_menu ul
- custom rearranged menu with excerpt for selected children in sidebar.php
- Active menu also for single array
- Menu – custom structure
- TwentyTwelve child theme: Incorrect footer menu
- adding a numbers to a item from navigation menu
- Rogue current menu item class in wp_nav_menu()
- Two pages named the same thing, on a different level but conflicting url paths in menus and direct links
- How do I change the default wordpress navigation header that comes with my theme?
- To Add Logout Button in Menu [duplicate]
- menu_class showing up on DIV instead of UL
- deleted menu still present [closed]
- Some informations about the use of statics pages in WordPress
- Why there is a gap between and it’s container (A drop down menu in wordpress) [closed]
- How was this menu system created?
- How can i make two menu walkers with logo in center?
- Broken drop down menu using Bootstrap and navwalker class
- Is it possible to animate the Twenty Eleven menu? [closed]
- Add acf custom fields so sub item in menus
- change breakpoint widths for divi theme tablet view