Create multiple menus for each parent page and use an if condition to test which is the parent page and output that particular menu.
You could keep the menu names the same as the parent page names so that any future pages created with new menus will still work.
empty( $post->post_parent ) ? $post_parent_name = get_the_title( $post->ID ) : get_the_title( $post->post_parent );
wp_nav_menu( array(
'menu' => $post_parent_name
));
not tested but something along those lines should work.
Hope this helps
Related Posts:
- Remove Container Element From wp_nav_menu() Markup
- Breadcrumbs showing Parent and Child Pages
- Return only top-level navigation items from a menu using wp_get_nav_menu_items
- Menu fallback “menu_class” rendering a “div” instead of a “ul”
- How do I create page navigation linking to each H2 within the page? [closed]
- Custom Static Links For Specific Menu Right Before/Next The wp_nav_menu Function now working
- Categories as main menu items and subcategories as nested lists
- retrieves menu and converts it to a readable array
- Secondary Menu and Logged In Users
- Default Nav Highlight
- How would I make a function to dynamically determine if user is logged to change navigation menu text?
- Bizarre Child Menu Issue on WP Site
- How to automatically add counted number to navigation menu items?
- How to add widget in main menu
- How to add a data attribute to a WordPress menu item
- Get the ID of the page a menu item links to?
- Add container to nav_menu sub menu
- Mega Menu Walker
- Get menu object from theme_location
- Displaying Logged-In User Name in WordPress Menu
- Using wp_get_nav_menu_items() to list children of children pages
- How to target specific wp_nav_menu in function?
- Custom menus displaying all pages instead of set pages
- How to manually add an item to a submenu in a menu generated by wp_nav_menu?
- How to activate “Description” metabox for menu item programmatically?
- Dynamically add sub-categories to any category in the menu
- Breadcrumb how i can display page title with parent > child title with permalink ? any Idea
- Two different menus for two different locations?
- automatically adding submenu items
- Unregister Nav Menu with fallback?
- How to programmatically set a menu to be the Primary Menu?
- Editing or filtering the output of the Genesis navigation
- Logout and redirect using the WP Menu
- Make menu structure match page heirarchy on page parent change
- Is there a way to add a class to non current menu item?
- Logout hyperlink within a sub-menu
- CSS for menu item added via functions.php
- How To Remove Duplicate Menu Locations
- Where do I add html code to the menu div?
- Breadcrumbs – Exclude Child Categories
- Replace menu links with # and add name to its li
- Function issue with Walker_Nav_Menu [duplicate]
- Why does the ‘wp_nav_menu’ function work only until a menu is created?
- Hide Hamburger Menu On Specific Page (Front Page/Home Page)
- Make parent page only link to first subpage
- How to add nav menu items to a specific position within a menu
- wp_nav_menu, walker class, categories as classes of li
- Hard-coding custom menu elements for menu manager
- Custom Nav Walker sub-menu
- How to fetch the name of the active menu?
- Replace a menu with widget or a custom template file programmatically
- Detecting classes, adding widgets, and adding divs in with a Nav Walker
- How to get correct URLs in network wide menu (Multisite)?
- Removing specific menu items?
- append to existing parent theme function
- How do I hook into the container of wp_nav_menu?
- Add login hyperlink to secondary navigation menu
- New custom menu created. how to apply it?
- Dropline menus — seperators between children only?
- Filter nav menu items HTML tags and wrap inner text with span
- Functions php shortcode for displaying main menu with no child items
- Nav menus all outputting the same links
- Change menu based on page template via functions.php
- Show some menu sub items as dropdown under a menu item
- How to add custom li item to wordpress menu
- Add Login/Logout Menu Item to Primary Nav “My Account” Submenu [Woocommerce] [closed]
- why is this function firing on all child menu items as well?
- Different methods of adding menu support to custom theme
- Adding a section in line at the end of the main navigation menu in php
- wp_nav_menu work in functions.php but not in the theme
- How to register a menu based on a ACF condition
- How to hightlight all ancestor menu items of a child page NOT displayed in menu
- Nav-Menu not showing up
- current_page_item is missing inside wp_nav_menu
- search form leads to 404
- Unable to add extra elements to the main navi (wp_nav_menu_items)
- How Can I add a menu to the theme from withen the function.php file
- define css class in functions.php
- Custom Menu in Admin doesn’t change menu in browser
- Conditional custom menu?
- wp_nav_menu displaying all pages
- Warning at top of website & top menu gone
- How to display an image before title text in menu items
- Header menu aligned right on all pages except for single-post page [closed]
- Combine multiple menus using the filter wp_nav_menu_items
- Menu and category highlighting for a single post
- WordPress Toggle Menu has stopped working
- Setting Active Nav item (of Pages) when you are on a Post with Category
- Language Switch Function
- Insert menu into theme location depending on user logged in/out status
- Adding custom field in menu options [duplicate]
- Calling the first & last post by category in custom post type
- Modify sub_menu function to show pages below a specifically set page
- wp_nav_walker that interacts with widgets to setup mega menu
- Adding a filter with custom function to the menu / navigation
- How to add a class name to the ancestor of a post?
- Undefined offset: 2
- Function Reference for custom link in Admin Menu Management Page
- How do I get my nav menu to show sub pages?
- Notice: Use of undefined constant REQUEST_URI – assumed ‘REQUEST_URI’ in ….functions.php on line 73