Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I have a Genesis child theme that I bought, and it only supports two menus, a primary and a secondary. However, for what I would like to do with my site I need to have 6 menus all together.

This is my website http://thenottypicalarmywife.com

This is what I want the menus to look like http://livingwellspendingless.com with the menus across the top of the page.

share|improve this question

3 Answers 3

You should register your new menu first, usually in functions.php:

add_action( 'after_setup_theme', 'the_theme_setup' );
function the_theme_setup() {
    // Register mymenu
    register_nav_menu( 'mymenu', __('My Menu' ) );
 }

Then, in the admin menu manager you can build the menu and assing it to the new menu location you have previously register. After that, you can render the menu where you want it to be displayed in your theme:

//For more params see http://codex.wordpress.org/Function_Reference/wp_nav_menu
wp_nav_menu( array(
                   'theme_location' => 'mymenu',
                  ) );
share|improve this answer

Here's 2 options:

First: The code goes in your child themes functions file and creates one extra menu which displays in the genesis_after_header position.

There are 2 steps needed to add new nav menus.

One. Register the menu(s) using the init action hook NOT after_theme_setup

Two. Hook the menu into a theme hook location ( You could replace the 2nd step with the template code which displays the menu however this is not best practice when modifying Genesis and reserved for parent theme development)

function register_additional_genesis_menus() {

register_nav_menu( 'third-menu' ,
__( 'Third Navigation Menu' ));
}
add_action( 'init', 'register_additional_genesis_menus' );

add_action( 'genesis_after_header', 'add_third_nav' ); 

function add_third_nav() {

wp_nav_menu( array( 
'theme_location' => 'third-menu', 
'container_class' => 'genesis-nav-menu' ) );
}

Simply change the genesis_after_header hook to the correct hook location you want to display your menu.

You can also change the container class (nav-menu) to match the existing Genesis nav menu class or you would need to add a lot of CSS if you use a unique class.

You can also register multiple menus using register_nav_menus( $locations );

function register_multiple_menus() {

register_nav_menus( array(
'menu_three' => 'Menu Name',
'menu_four' => 'Menu Name',
    'menu_five' => 'Menu Name',
    'menu_six' => 'Menu Name'
) );
add_action( 'init', 'register_multiple_menus' );

Second: Genesis also includes a built in function which enables you to add theme support for additional menus.

This code goes in your child themes functions file and creates 6 nav menus.

remove_theme_support ( 'genesis-menus' );
add_theme_support ( 'genesis-menus' , array ( 
'primary' => 'Primary Navigation Menu' , 
'secondary' => 'Second Navigation Menu' ,
'third' => 'Third Navigation Menu' ,
'fourth' => 'Fourth Navigation Menu' ,
'fifth' => 'Fifth Navigation Menu' ,
'six' => 'Six Navigation Menu' 
) );

add_action( 'genesis_after_header', 'genesis_do_more_navs' ); 

function genesis_do_more_navs() {

wp_nav_menu( array( 'theme_location' => 'primary', 'container_class' => 'genesis-nav-menu' ) );
wp_nav_menu( array( 'theme_location' => 'secondary', 'container_class' => 'genesis-nav-menu' ) );
wp_nav_menu( array( 'theme_location' => 'third', 'container_class' => 'genesis-nav-menu' ) );
wp_nav_menu( array( 'theme_location' => 'fourth', 'container_class' => 'genesis-nav-menu' ) );
wp_nav_menu( array( 'theme_location' => 'fifth', 'container_class' => 'genesis-nav-menu' ) );
wp_nav_menu( array( 'theme_location' => 'six', 'container_class' => 'genesis-nav-menu' ) );

}

You can wrap each in an existing class or wrap the lot in an existing or new menu class.

Clearly, these are not the only methods you can use to add new menus in WordPress or Genesis however its a good option for child theme users where Genesis supports the use of custom functions rather then editing parent theme template files.

Source http://codex.wordpress.org/Function_Reference/wp_nav_menu

share|improve this answer
    
The Genesis framework in this question came after I posted my answer. Anyway, the statement about registering menus always in init and not in after_theme_setup is not true. You can see how wordpress core themes register menus in after_theme_setup as well in some oficial documentation pages like codex.wordpress.org/Plugin_API/Action_Reference/…. In fact, navigation menus are defined by Wordpress as a "theme feature", so after_theme_setup is very appropiate hook. –  cybmeta Feb 2 at 18:01
    
Its not the hook the WordPress Codex uses in its working examples. –  Brad Dalton Feb 3 at 8:39
    
See the examples in the link I posted. –  cybmeta Feb 3 at 15:34

Create your menus in the admin, then use <?php wp_nav_menu( array('menu' => 'Menu Name' )); ?> to place them in your templates.

That would be the easiest method.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.