How to Register Navigation Menus of our Custom Theme in WordPress? Part-7

How to Register Navigation Menus of our Custom Theme in WordPress?

What are the Navigation Menus?

Navigation-Menus are customizable menus in your theme. They allow users to add Pages, Posts, Categories, and URLs to the menu. To create a navigation menu you’ll need to register it, and then display the menu in the appropriate location in your theme.

  1. Create a functions.php file into the Customer Theme folder.

Register menu

2. Use of register_nav_menus() to register the menu. Register navigation menu locations for a theme. The Primary menu and Footer menu are the names of the menus. The “init” is the action. About Action Hooks go to https://developer.wordpress.org/plugins/hooks/actions/ .

3. Go to Dashboard and Click Appearance->Menus.

Menus section of Custom Theme has appeared now.

4. For displaying the Primary menu and Footer menu, we have to create the Header menu for Custom Theme and click Create Menu.

Now, we can see the Primary menu and Footer menu has created.

Thanks