You need to replace the end_lvl
method of Walker_Nav_Menu
as well. This is what you would need to add:
public function end_lvl( &$output, $depth = 0, $args = array() ) {
if ( isset( $args->item_spacing ) && 'discard' === $args->item_spacing ) {
$t="";
$n = '';
} else {
$t = "\t";
$n = "\n";
}
$indent = str_repeat( $t, $depth );
$output .= "$indent</div>{$n}";
}
The only change from the original is the </ul>
was changed to </div>
Related Posts:
- How to use wp_nav_menu to create custom dropdown menu?
- PHP drop down menu for my get_category child of
- Open WordPress Page from selected option dropdown
- Mega Menu Walker
- Displaying Logged-In User Name in WordPress Menu
- renaming an admin menu item with decimal array index number
- How can I hook into and edit the text of a wp_nav_menu tag?
- Drop down+sort blog posts date added/most popular
- Save selected item from dropdown menu in a meta box as a metadata value for a custom post type
- How to show only parents subpages of current page item in vertical menu?
- How do I create a drop down menu in a widget?
- The best way to customize “nav-menu-template.php” to add if the ‘link_before’ is “checkbox”
- Can we have a php “page” without a WordPress “page”?
- removing tags from wp_list_pages() using PHP
- wp_delete_auto_drafts() deletes links in menus
- How can I add a class to a single menu item?
- How to add specific menu on a specific page or pages
- Unusable menus and “Illegal widget setting ID: nav_menu_item[]” error
- WordPress menu deletes when trying to add a hook
- Logout and redirect using the WP Menu
- Second Navigation inside header
- Creating new menu item
- Archive dropdown styling not applied
- Getting the dropdown menu to redirect to different pages?
- Programmatically create menu with custom link
- Custom Loop through category menu to include sub categories
- selected menu item
- Add itemprop Schema.org Markup to li Elements in wp_nav_menu
- How to display conditional-content if wp_nav_menu( $args ) retruns something
- Can’t extend some core classes
- Show comments menu in dashboard only if the site has comment
- Trouble creating conditional PHP for nav menu items with children for custom Walker
- Count top level menu items
- create a select input with menus created on a custom options page
- Menu — How to add “current-menu-grand-ancestor” css class
- Hide Hamburger Menu On Specific Page (Front Page/Home Page)
- Menu Limitations
- Filter Select results based on selection
- Easiest way to add dropdown to a page
- How to pick the default selected value in wordpress dropdown?
- Custom Walker_Nav_Menu issue with variables on PHP 7.3
- How to add an arrow to menu items has submenus
- wp_nav_menu returns menu list in ascending order. How can I arrange the menu same as dashboard menu
- Secondary navigation menu on one page
- Remove class in nav_menu_link_attibutes filter
- WordPress Quick Question . How to Get Parent Link in Submenu in My Code
- Display parent and child taxonomies in separate drop down select fields
- Detecting classes, adding widgets, and adding divs in with a Nav Walker
- Custom Menus: dynamic highlighting problem with custom home link
- Add item to top of menu using a filter in functions.php
- Adding PHP in the menu
- How to style one item from main navigation?
- New walker for walker_nav_menu to change inside container data
- Add data-id attribute to child page links
- Isotope Drop Down Categories Filter Function
- Automatically add images to a menu
- Menu Custom Data Attributes
- How to modify mobile nav menu text in theme
- How can I use custom menus with a Bootstrap WordPress theme?
- Nav menu from plugin to theme
- Adding Additional Variables on Menus Page
- Save the value of a wp_dropdown_pages
- Nav-Menu not showing up
- Custom navigation menu with awsAccordion
- Why in this WordPress theme I can’t see the Main Menu?
- wp nav menu: show submenu below li item
- go to home page when i select default in select-box
- Dynamic Menu drops pages?
- Class for Selected Menu using wp_nav_menu
- Styling an “active” link outside of WordPress default menu
- How to create Loop code for Menu using WordPress?
- Nav Walker that shows only children and siblings of top level parent menu item
- how to changes mobile menu toggle breakpoint in WordPress
- How to display already created menus via php?
- Featured image in menu wordpres
- How to make a pagination with dropdown selection?
- How to set Nav as a default menu in wordpress
- How to let mobile navigation menu close when link is clicked?
- Get Child of Child Pages in custom Menu
- PHP warning with code for nav menu walker [duplicate]
- How to disable sub menu items from being created?
- String replace for Login/Logout concatenation problem in menu
- Bring Font Awesome icons inside menu A tags
- Display specific main Sub Nav on Woocommerce product pages
- Widget Logic – display on page and all child
- Editing existing pre-created menus in PHP
- wp_nav_menu prints children with parent name
- WP Admin Bar – Get current theme name as custom menu title
- Active class not working on custom menu link using add_menu_page
- custom field meta-box with dropdown/autocomplete
- Page 2+ of taxonomy archives does not recognise sort-order from dropdown
- How to get the count for each taxonomy term
- Custom Links in Walker Class
- Dropdown Menu for Query_Posts
- Submenu opened problem
- WordPress menu links with images & class selection
- Remove Unused Menu Locations
- Contact form with dynamic dropdown and filter
- How to add different menu items on different menus?
- Nav menù doesn’t display selected pages