Things you need to know about menus in WordPress

Things you need to know about menus in WordPress

You can't imagine how much questions we get every day concerning menus:

  • How To remove "No Categories" from my main menu?
  • Why does my menu has too much items?
  • How to add "Home" link to my menu?
  • Where I can customize my menu ?
  • How to remove the Top/Main menu and etc.

Have you found some of your questions here? So you will find the answers as well. This article will definitely give you an in-depth look at how to customize WordPress menu and shed light on the solution of many problems.

By default WordPress theme from SMThemes has 2 menus: 

  1. Top  Page menu which is a list of WordPress pages created in the administrative panel
  2. Main Categories menu which contains your "Home" link and list of categories.

Actually, you don't have to use only these default menus and limit yourself in categories or pages. Our free themes support menus customization options which allow you to create a menu that fits your needs. Look at the picture below:

Here we are on the "Appearance" page in the dashboard of WordPress website.

Have you been here before? If yes, the first 4 questions listed in the beginning of this post are not difficult for you. However, I will explain how it works for those who is not professional in WordPress yet.

How to add "Home" link to my menu?

Probably, you have already guessed how to solve this issue ;)

First of all you have to create a new menu:

  1.  click "Create menu" on the top of this page
  2.  set menu name
  3. click "Custom Links"
  4. enter URL of your home page & link text
  5. press the "Add to Menu" button
  6. save changes next to the menu name at the top of the page
  7. choose the "Manage locations" tab
  8. select the newly created menu as Top/Main menu

The same instruction will help you to create your own menu and remove "No Categories" from your menu. This menu item appears if default Category menu is set, but you have no categories and it is empty. So you just need to create a new menu or remove this menu if you don't really need it.

How to remove the Top/Main menu?

Solution is extremely simple! You have to remove the code which calls menu function. For the top menu this code usually looks like:

     <!-- Top Menu -->		
             <p id='top-menu'>
<?php wp_nav_menu(array(
'menu_class'=>'menus menu-topmenu',
)); ?>
<!-- / Top Menu -->

To remove the Main menu you have to remove the code:
 <!-- Main Menu -->
<p id='main-menu'>
<?php wp_nav_menu(array(
'menu_class'=>'menus menu-primary',
)); ?>
<!-- / Main Menu -->

The last thing you have to do is to delete the appropriate code for proper mobile view: 

    top menu: <?php smt_mobile_menu('sec-menu'); ?>
    main menu: <?php smt_mobile_menu('main-menu'); ?>

 Note: all these code you may find in the header.php file of the theme or top.php file for old themes.

More complex issues will be discussed in the next publications.

Leave a Reply