Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
  • #14397


    How do I enable wordpress menus? I have come to the point where I need to add a main menu item which links to a subdomain hosted externally from wordpress. An alternative way would do but enabling menus would just make life easier.



    Hi mariseliass,

    1. Add this simple line to your functions.php file:

    if( function_exists('register_nav_menus')) {
    register_nav_menus( array('main_nav' => 'Main Navigation Menu' ) );

    You can place this at the bottom of functions.php

    2. Add this code in your header.php:

    <nav><?php wp_nav_menu(array('menu' => 'Main Nav Menu')); ?></nav>

    place this code inside your header div or where you want it to be placed.

    3. Then go to Appearance > Menus. Create a menu and name it “Main Nav Menu” (the same with name in #2). After creating the menu, Add some links to the menu.

    Hope this helps. :)




    Thanks Ismael,

    Got the functions updated:

    Copied the Nav line in the head div:

    and all I got is my old menu in the place with the new one showing up on the background as a list:




    You can target the specific menu by naming them.

    <nav><?php wp_nav_menu(array('menu' => 'Main Nav Menu')); ?></nav>

    You can change “Main Nav Menu” to something else. Add a new set of menu then use that name on your Appearance > Menus.

    Please see this reference for further support.




    –>> for those reading on the topic – you will have to restyle the menu after this procedure.

    Thanks for all your help Ismael.


    Hi mariseliass,

    Glad that I could help you. :)



Viewing 6 posts - 1 through 6 (of 6 total)

The topic ‘How do I enable wordpress menus?’ is closed to new replies.