Do you want to add multiple custom menus with multiple locations on your WordPress website without a plugin?
Then you land at the right place.
Here:
We have written simple function code that will add multiple (two in this example) custom menus easily.
Just do the following things:
Multiple Custom Menus
First of all let’s register multiple menus:
Copy and paste the below functions code into your WordPress theme’s functions.php file.
Code for Registering WordPress Menus
After that:
(Optional) Change the menu name from primary-menu
, secondary-menu
and it’s value from ‘Primary Menu’, ‘Secondary Menu’ to whatever you want or else you can leave as it is.
Now let’s display registered menus with wp_nav_menu:
Copy the below code and paste it into your header.php file or footer.php file (in which page you want to show the menus).
Code for Showing Primary Menus:
In the below code, we are showing Primary Menu on header area by pasting code into header.php file.
Code for Showing Secondary Menu:
In the below we code, we are showing Secondary Menu on footer area by pasting code into footer.php file.
You can also add some
That’s it.
Video Guide: Create Multiple Custom Menus
Hope you guys understood this guide.
Let us know what’s you opinion about this post and questions in the comment section.
Don’t forget to share this WordPress Multiple Custom Menus Guide.
Thank you