askdesign
11/11/2015 - 5:33 PM

How to Register an Additional Nav Menu in Genesis

Calvin Koepke

<?php
//* METHOD 1 - http://calvinkoepke.com/register-navigation-menu-genesis/
//* Step (1) Register the menu
//* Do NOT include the opening PHP tag
//* Add support for additional menu
add_theme_support ( 'genesis-menus' , array ( 
  'primary' => 'Primary Navigation Menu',
  'secondary' => 'Secondary Navigation Menu',
  'footer' => 'Footer Navigation Menu'
) );

<?php
//* METHOD 1 - Step (2) Outputs that menu at our specified location with a hook
//* Do NOT include the opening PHP tag
//* Function to output additional menu right before opening footer tag in Genesis
add_action( 'genesis_before_footer', 'ck_footer_menu' );
function ck_footer_menu() {
  printf( '<nav %s>', genesis_attr( 'nav-footer' ) );
  
  wp_nav_menu( array(
    'theme_location' => 'footer',
    'container'      => false,
    'depth'          => 1,
    'fallback_cb'    => false,
    'menu_class'     => 'genesis-nav-menu',		
  ) );
  
  echo '</nav>';
}