This is actually not that difficult if you already know how the walker class works. You would need two calls to wp_nav_menu. The first one you have should already work, because the function natively allows you to select only the top level.
What it doesn’t allow you to is to select everything but the top level. So you need a separate walker, which you would call like this:
wp_nav_menu( array(
'theme_location' => 'primary',
'walker' => new wpse215647_walker(),
'container' => false,
) );
In your walker you must make sure all items are included, except the top level. That question already has an answer here.
Related Posts:
- Nav walker, bootstrap: Display 3rd level items under 2nd level
- Nav walker bootstrap: Display 3rd level and 4th level in dropdown menu
- Display only page specific sub menu items using Custom Walker
- Multi Level Bootstrap Navigation Menu in WordPress
- Add class to top level menu item if it has multiple child levels
- Simple Navigation Walker – Wrapper-class around first sub-menu
- Output the aria-labelledby parameter for a nav menu child
- Custom Nav Walker sub-menu HTML construct
- Check if wp_nav_menu items have submenus
- Add div to specific sub-menu
- Sub-Pages only of menu items in current branch using a custom menu
- How to display dynamic content in start_lvl function
- How to add a submenu toggle button inside all “li” elements that have a submenu?
- How to construct a custom html for submenus
- How to add ID attribute to each submenu?
- WordPress Walker – Group two items?
- Change submenu markup
- getting the current sub item out of total sub items in a given dropdown (custom walker)
- How to Add support for sub-menu item description in wordpress?
- How can I creat custom menu with bootstrap
- WordPress + Bootstrap: Replace primary navigation menu on mobile?
- Stuck while adding bootstrap navwalker class
- Menu walker: how to tell if a sub menu contains submenus?
- Where to place a svg chevron down in my custom walker?
- Displaying a part of a menu containing the page the user is currently viewing and only it’s immediate children
- Conditional Nav Menu Inside Nav Menu Across Multisite Sites
- Broken drop down menu using Bootstrap and navwalker class
- nav tag wrapping around dropdown
- WordPress nav Walker – Bootstrap 5.2.3 – submenu not opening
- Add custom menu item using wp_nav_menu_items filter
- How does a minimal menu walker look like?
- Add separator to admin submenu
- How to create this custom menu walker?
- How do I pass an argument to my custom walker?
- How to get a separate child menu?
- wordpress nav menu using twitter bootstrap
- HTML Bootstrap navigation menu to WordPress menu using wp_nav_menu
- Adding a class (arrows) to main menu links that have children?
- Adding html elements to wp nav menu
- Bar separated navigation by extending Walker_Nav_Menu
- Programmatically adding menu items function replicates in multiple menus
- Custom Nav Walker to show siblings and children of current branch?
- Getting post content within wp_nav_walker
- wp_list_pages: only show subpages on the parent page?
- Counting top level items in a custom menu walker
- Make menu bootstrap compatible
- WordPress sub-menu items suddenly not showing
- Does loading of sub pages in menu cause load to the server?
- Add dynamic Sitemap to footer
- Update body class based on menu
- How do I separate link levels in a custom menu walker?
- Highlight current post ancestor parent menu items
- walker – 0 level on submenu formatting
- Difference between walker class and basic php
- Custom navigation structure with walker class
- CSS_Menu_Walker not showing on mobile view?
- How to add class to parent a tag with a sub menu
- How to highlight 1st level menu item based on actual page
- How to actually make menu walker alive on admin interface?
- Adding sub-menu item makes parent item unclickable
- Add Labels to Admin Menu ( How To )
- Problem adding ‘has-children’ class to wp_nav_menu
- Remove a class from a using Walker
- Add (grand)child pages automatically to nav menu
- Creating menu always gives error A name is required for this term
- wp_nav_menu: Is there a way to modify the output of that got a submenu?
- Make two bootstrap menus collapse into one dropdown
- How to convert the argument of wp_list_pages to an array
- How to change the menu mark up with walker_nav_menu class?
- Replace anchor tag with span tag
- How to get current pages menu text?
- Costum walker with sub menu item count
- How to include second layer sub menu to Walker Nav?
- Can I now add a class in the anchor of my menu item with WordPress 5.4?
- Multi-Level Nav Bar
- Add CSS Class to WordPress Menu Item Dependent on the Page the User is Visiting
- Nav_walker add id to dropdown ul
- Navbar is hidden behind carousel when using wp-boostrap-navwalker
- Change markup for just 2nd list element in custom Walker menu
- Getting parent object_id of child menu items in WordPress menu
- How to remove a sub-menu using walker hooks/filters without relying on a custom walker?
- Incorrect Behavior on WordPress Main Menu
- Parent link need to go first child submenu
- Importing large product categories into wordpress menu
- Custom wordpress submenu
- Walker or wp_get_nav_menu_items VS jQuery
- I can’t correctly display menu
- WPML CMS Nav and Custom Nav_Walker Undefined Property Notices [closed]
- How to add odd and even classes to all nav links through walker?
- Output sort number in wp menu list item?
- Is it possible to separate all submenu items?
- Reveal hidden submenus on page load – Twenty Fifteen theme
- Check in walker if current page is descendant
- Specific Page that convert Hyperlink to anchor in nav menu
- Add a Submenu from Another Submenu in a Custom Theme
- Customize Walker_nav_menu to show posts if item is category
- Adding two submenus to a menu
- Menu support for touch devices
- collapse twenty twelve submenu in mobile version
- There is no option to click the button in header only on some pages