← MARC RIDENOUR Danny Aden Jr. →
//* Remove the Header Right widget area
unregister_sidebar( 'header-right' );
// Register Header Navigation Menu
register_nav_menu( 'header', 'Header Navigation Menu' );
// Add Theme Support for Genesis Menus
add_theme_support( 'genesis-menus', array(
'primary' => __( 'Primary Navigation Menu', 'genesis' ),
'secondary' => __( 'Secondary Navigation Menu', 'genesis' ),
'header' => __( 'Header Navigation Menu', 'genesis' ),
) );
// Add Attributes for Navigation Elements
add_filter( 'genesis_attr_nav-header', 'genesis_attributes_nav' );
// Remove the standard Header content
remove_action( 'genesis_header', 'genesis_do_header' );
// Add custom Header content
add_action( 'genesis_header', 'custom_do_header' );
function custom_do_header() {
if ( wp_is_mobile() ) {
echo '
';
// wp_nav_menu(
// array(
// 'menu' => 'menu1',
// 'container' => 'nav',
// 'menu_class' => 'genesis-nav-menu'
// )
// );
genesis_nav_menu( array(
'theme_location' => 'header',
'menu_class' => 'menu genesis-nav-menu',
) );
}
else {
$divider_html = '
';
wp_nav_menu(
array(
// 'menu' => 'menu1',
'theme_location' => 'header',
'divider_html' => $divider_html,
'container' => 'nav',
'menu_class' => 'genesis-nav-menu'
)
);
}
}
//* Enqueue Mobile Responsive Menu
add_action( 'wp_enqueue_scripts', 'mobile_responsive_menu' );
function mobile_responsive_menu() {
wp_enqueue_script( 'mobile-first-responsive-menu', get_bloginfo( 'stylesheet_directory' ) . '/js/responsive-menu.js', array( 'jquery' ), '1.0.0' );
wp_enqueue_style( 'dashicons' );
}