Adding Another Menu Under Theme Locations

Supplemental 35 views
0 Flares 0 Flares ×

In order to add another drop-down menu under Appearance > Menus > Theme Locations (top left) you need to add this bit of code to your functions.php. Note that this is just an example. You need to find where this is already located in your functions.php and if you are starting from scratch you will have to add the whole thing.

	/* Register Navigation */
	register_nav_menus( array(
		'topbar' => __( 'Top Bar Menu' ),
		'another_menu' => __( 'Another Menu' ),
	) );

This will add the drop-down selection to add another menu. Now to add it to your theme you will need to add this wherever you want the menu to display in your template:

<?php wp_nav_menu( array( 'theme_location' => 'topbar', ); ) ?>

Many arguments can be passed through this. It’s just the basic way. For more information visit both wp_nav_menu & register_nav_menus.

Tagged with:
Posted in Wordpress


Leave a Reply

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


You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>

No Trackbacks.


Register | Lost your password?
0 Flares Twitter 0 Facebook 0 Google+ 0 0 Flares ×