Hi,
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.
Thanks!
Hi,
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.
Thanks!
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. :)
Regards,
Ismael
Thanks Ismael,
Got the functions updated:
http://www.screencast.com/t/oDh7Oam7xTV
Copied the Nav line in the head div:
http://www.screencast.com/t/NeAcmdsG
and all I got is my old menu in the place with the new one showing up on the background as a list:
http://www.screencast.com/t/KuWrhKCEh
Suggestions?
Hi,
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. http://codex.wordpress.org/Function_Reference/wp_nav_menu
Regards,
Ismael
-->> 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. :)
Cheers,
Ismael
You must log in to post.