
So, open up the functions.php file and put the following code inside the nd_dosth_theme_setup action: Because they both convey the same meaning, isn’t it? But, as we build our website, we will come back to this function and register more menus.įrom now onwards, I will use the word “custom menu” and “menu” interchangeably. So you don’t have to use:Īnyway, For now, we will be registering just one custom menu. It also enables theme support for custom menus. The register_nav_menus() WordPress function helps us to register multiple navigation menus at the same time.

#WP DISPLAY MENU BY NAME MOVIE#
Have a leap of faith in me, will you? ( Between I am writing this lesson just after watching the Spider-Man: Into the Spider-Verse movie ) Step 1: Register the menu

Trust me, everything will make sense to you once you are done with step 4. Finally, Output the custom menu using the menu IDĪlright alright, I agree that the above description and the image is a bit skeptical.Link the newly created custom menu from step 2 to the menu ID from step 1.Create the custom menu using the Admin Dashboard -> Appearance -> Menus.While the Menu ID helps us output the menu to the frontend in step 4, the description helps us recognize and properly link the custom menu in step 3 Register the custom menu inside your theme by providing a unique Menu ID and a small description of the menu.It takes four steps to create and output a custom menu to the browser. So, creating and outputting a full-fledged custom menu is probably the easiest job while developing a WordPress website. In the world of WordPress, we call the navigation menu in the above picture as a “Custom Menu”Ĭustom menus are also a theme feature.
