Home / Tech Guide / How to add more Navigation Menus to Your WordPress Blog Theme?

How to add more Navigation Menus to Your WordPress Blog Theme?

/
/
/
630 Views

Hello Friends, Today we learn about how to add more navigation menus to your WordPress Blog Theme. Sometimes you may need to add an extra navigation menu with important or frequently used links to increase the usability of your WordPress site.

To create a new menu in WordPpress blog theme you need to edit your theme files. Before making changes to any of your core files, it’s best to backup your entire site in case something goes wrong along the way or something crash your theme.

Let’s begin

To add a new menu location option in your admin dashboard under Appearance > Menus you need to ‘register a menu’. All it takes is adding a snippet of code to your ‘functions.php’ file located under/wp-content/themes/xxxx/ directory on the server.

Registering New Menu

Access your server using ftp client like (filezilla, php designer) or FileManager provided by your webhost. Navigate to /wp-content/themes/xxxx/ directory on your server. Open the ‘functions.php’ file for editing.

how_to_add_more_navigation_menus_to_your_wordpress_theme_1

Now Scroll Down to bottom of the file. If you’d like to add only one menu, add the following code in function.php on a new line:

above this example, ‘Additional Menu’ is the name that will appear in your admin dashboard’s menu page. The ‘additional-menu’ name is what WordPress will understand to execute your code properly.

If you would like to add multiple menus to your site, add this code on a new line instead:

Now you can add as new menus as you’d like with this method. The same rules will apply when naming them. Save the changes you made this the file.

Creating New Menu in WordPress->Menu Dashboard

Go to Dashboard > Appearance > Menus in your dashboard. You’ll notice your new menus will be listed under Theme Locations in the Manage Location section.

how_to_add_more_navigation_menus_to_your_wordpress_theme_2

Now feel free to create a new menu or use an existing one. Once you have created a new menu, you can also manage the locations where they are displayed under the ‘Manage Locations’ tab.

Now We are Adding this Menu Locations to Your WordPress Blog Theme

Now you can decide where you need to decide where you’d like to place your navigation menu in you WordPress Blog Theme. If you’d like your menu to appear at the top of your page, you’ll need to edit the ‘header.php’ file. You can also put it in your footer which means you would edit the ‘footer.php’ file. You can even display a menu on a page by editing its template file or to a sidebar, editing its ‘sidebar.php’ file.

You can place your new menu where ever you’d like. Here’s the minimum amount of code you need to add to any of these locations:

Where additional-menu is your new menu.

You probably want to style your menu with CSS so it goes beyond basic functionality and also looks great. To do this, you’ll need to create a class and add it to your theme with the following code:

Again, replace additional-menu with the menu name you choose. We created ‘addnew_menu_class’ class as an example, feel free to specify your own style class here. Do not forget to add style rules for the new created class in your style.CSS file which is located under /wp-content/themes/xxxx/directory on the server.

This is it, your theme got an additional menu and now you are one step closer to the greatest site ever.

That’s Thank you for watching @thinknowledge

[amazon_link asins='B017ID54G6,B00C77U612,B017ID54G6,B00AUYYVZQ,B01LYSSFM7,8126554568,8131791882,1515233146,B01GSODGZC,1534954546' template='ProductCarousel' store='thinknowledge-21' marketplace='IN' link_id='c8bd129a-4dd0-11e7-80e2-3bd285adad9e']
  • Facebook
  • Twitter
  • Google+
  • Linkedin

Leave a Comment

Your email address will not be published. Required fields are marked *

0 Shares
+1
Tweet
Share
Share
Pin