Register a menu is really register a menu location, but I think you don’t need to register locations so you can avoid the register step. I think what you need is wp_nav_menu( )
function. For example, in the page template:
//Get the menu slug stored in page custom meta field
//Replace menu_meta_field_name with the correct name of the meta field
$menu_slug = get_post_meta( get_queried_object_id(), 'menu_meta_field_name', true);
wp_nav_menu( array( 'menu' => $menu_slug ) );
Related Posts:
- Remove unusable metaboxes in nav menu management screen
- How to Move the Author Metabox into the “Publish” metabox?
- Remove Metabox from Menus screen
- Add custom menu item metabox in Navigation Settings
- Add custom links like functionality
- How do I enable “metaboxes” by default in menu editor?
- Add a menu metabox to post edit page
- Specific Page that convert Hyperlink to anchor in nav menu
- Display a portion/ branch of the menu tree using wp_nav_menu()
- Unregister Nav Menu from Child-Theme
- Display only page specific sub menu items using Custom Walker
- non-clickable placeholder in the menu
- Keeping parent menu items active in child pages
- Pass a parameter to a menu walker
- Menu is not visible in appearance
- Customize the menu by adding items
- Ways to give a wp_list_pages menu link specific class names?
- I want remove last after wp_nav_menu
- Organizing by super-categories (or nested categories)?
- Adding first and last class to Menu on top level only
- wp_list_pages – show pages immediately 1 level below current level
- wp_nav_menu log in/out link?
- Add within the output of
- How do I get my wp_nav_menu single category page to highlight the parent?
- How to insert custom code into wp_nav_menu structure?
- How to add custom menu item on plugin activation?
- Outside the loop, how can I echo the current page’s menu title?
- getting parent page id when using custom menu.
- Use menu class in walker function
- Menu link to all posts (all categories included)
- How do you return a menu with the menu name?
- Change name & menu_name for Profile in the default menu, w/o altering core files?
- wp-menu ‘automatically add custom taxonomy terms’ like it does for pages? [closed]
- You do not have permission to create Navigation Menus – Twenty Twenty-Two theme
- Walker class conditional based on parent menu item label or custom css class
- SlickNav – Google Lighthouse Accessibility issue for collapsed menu button
- Creating a navigation menu to see where you are on your website
- Put class on instead li
- Tiles as a navigation
- Custom format nav menu only using div and a
- Sticky Header in WordPress using BootstrapWP theme [closed]
- Default menu editor with automatic page list
- Switch from hover to click on Twenty Twelve Menu
- How can I switch pages?
- How to override menu markup?
- Automatically Display Sub Menu
- Recent Posts widget missing current_menu_item class
- WordPress custom Nav Walker
- How to get a multidimensional array of my menu?
- How to get the name of the homepage’s menu?
- In admin edit-menu screen, newly added menu items always go to the bottom of the list
- How to add search to menu?
- How to get submenu of admin menu?
- How can I make wp_nav_menu() support tags?
- How to add scroll IDs to WordPress menu anchors
- Active class to current link
- Making pages in a menu appear conditionally
- Modify the output of wp_nav_menu in a very specific way?
- Display pictures instead of text in menus
- how to check if given page is active page
- how to set the link in wordpress such that on clicking it doesn’t open another page but go to the bottom of same page
- custom walker class for own menu?
- WordPress Menu – creating a fake link [closed]
- Setting or plugin for showing submenus horizontally under the main menu, and keep them after selection
- (Mobile) Hamburger menu disappeared from a page (only one)
- Add div content to my already existing menu
- Hiding menu on specific pages
- sidebar navigation problem with child pages not all display.?
- How to point menu to my homepage
- save_post() on Menu Save
- dot.com/car1 does work, but dot.com/transport/car1 doesn’t work
- code to add an extra selection to the menu editor
- update_post_meta breaking wp_update_nav_menu_item
- Building a menu from a large number of pages?
- Dashicons not showed for admin menu
- How to select particular menu position in wordpress?
- Menus not visible in Appearance after being registered
- Cannot add home page url to menu with #
- Accidental reverse order of menu items in one menu
- Add dynamic content block to nav section generated by custom walker
- Customizing label/title output of admin nav_menu selecter
- Extend Individual Menu on Page Function to individual Submenue on Page Function?
- How do I remove a menu from a theme?
- How can I modify wp_nav_menu with walker?
- menu items outside of blog
- Walker for menus
- Custom Menu based off custom header
- Change sub-menu css class
- How to add an tag when a menu item is a dropdown(or has a sub-menu) [duplicate]
- Remove “Next Post” in nav_menu
- Adding an additional menu in WordPress
- Menu not Showing on Mobile or While the page is shrinked
- My Menu Disappears on my Custom Link Homepage on Mobile
- Add A Menu Item To A WP_Nav_Menu Navigation via PHP Function
- What is the best way to incorporate responsive dropdown navigation menu into custom theme?
- how to add permalink/slug to wordpress custom link menu item
- Using walker to display all menu branches at once?
- Submenu items not working anymore
- Icon not shown in Dropdown menus in Twenty Seventeen Theme
- How to change WP menu item type?