Open up your theme folder and locate the functions.php file. Search for a function called register_nav_menu (used in TwentyEleven theme) or register_gpp_menus (used in most GPP themes). It looks like this in many of our themes:
function register_gpp_menus() { register_nav_menus( array( 'main-menu' => __( 'Main Menu' ) ) ); }
We are going to add another item to the array, called Second Menu, like this:
function register_gpp_menus() { register_nav_menus( array( 'main-menu' => __( 'Main Menu' ), 'second-menu' => __( 'Second Menu' ) ) ); }
Now that we have registered a new nav menu item, you should see the Second Menu on your Theme – Menus page in your WordPress admin panel. Add menu items to it and save the menu. Now we need to display the menu somewhere in your theme. You can either add this to your theme files:
<?php wp_nav_menu( 'sort_column=menu_order&menu_class=sf-menu&theme_location=second-menu' ); ?>
Or, you can add the menu to a Widget using your Theme – Widgets panel in your WordPress admin panel. If you want to style your menu differently, you can add a different menu class to the wp_nav_menu() function above: menu_class=second-menu And then add some css to your custom CSS panel to help style that menu. This is not mandatory, though.
thanks! it really helps.
thanks! for helps.
Thank you Thad! Now if I can find a way to add a pipe symbol between each link….
Hi. I got the menu to appear in my theme but it seems as though the actual menu that appears reflects all the pages found in my ‘Pages’ menu rather than what is supposed to appear according to the ‘Menu’ pannel. How can I get the newly created menu to only display the pages specified in the ‘Menu’ pannel rather than a list of every page I have? You can see what I mean here Click Here
Hi,
You say “You can either add this to your theme files”. Which files? All of them?
Thanks
Thats brilliant – thank you!
Thank you sooooooo much for this! It was JUST what I needed, you’ve saved my life! 😉
Muito obrigado pela ajuda!
Thank!
That was helpful, thank you!
thank you for this, hope it will work on wpzoom theme as well..
http://www.alltechmantra.com
Hi
Great guide! Could you help me make the menu horizontal? I am familiar with css, but a kickstart would be greatly appreciated!
Thanks man!
thank you this was very helpful.
Got a 500 server error after adding this. it went away after deleting it. any idea why?
this was very helpful, thank you! How do I make the list horizontal instead of vertical? Thanks for your help!
I have added the first code in functions.php and in menu location its showing the secondary menu.
The question is where should i put the second code if i want to show nav menu in sidebar?
Thank you sooooooo much for this! It was JUST what I needed……..