Skip to content

Instantly share code, notes, and snippets.

@bradpotter bradpotter/functions.php
Last active Jul 18, 2017

Embed
What would you like to do?
How to Add “Top” and “Footer” Menus to Genesis
// Register and Hook Top Navigation Menu
add_action('genesis_before_header', 'sample_before_header_menu', 10);
function sample_before_header_menu() {
register_nav_menu( 'top', 'Top Navigation Menu' );
genesis_nav_menu( array(
'theme_location' => 'top',
'menu_class' => 'menu genesis-nav-menu menu-top',
) );
}
// Register and Hook Footer Navigation Menu
add_action('genesis_before_footer', 'sample_footer_menu', 10);
function sample_footer_menu() {
register_nav_menu( 'footer', 'Footer Navigation Menu' );
genesis_nav_menu( array(
'theme_location' => 'footer',
'menu_class' => 'menu genesis-nav-menu menu-footer',
) );
}
// Add Theme Support for Genesis Menus
add_theme_support( 'genesis-menus', array(
'primary' => __( 'Primary Navigation Menu', 'genesis' ),
'secondary' => __( 'Secondary Navigation Menu', 'genesis' ),
'top' => __( 'Top Navigation Menu', 'genesis' ),
'footer' => __( 'Footer Navigation Menu', 'genesis' ),
) );
// Add Structural Wraps
add_theme_support( 'genesis-structural-wraps', array(
'menu-top',
'menu-footer',
'header',
'nav',
'subnav',
'site-inner',
'footer-widgets',
'footer'
) );
// Add Attributes for Navigation Elements
add_filter( 'genesis_attr_nav-top', 'genesis_attributes_nav' );
add_filter( 'genesis_attr_nav-footer', 'genesis_attributes_nav' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.