Created
February 14, 2015 20:52
-
-
Save kontikidigital/9735d7832bb709a1893e to your computer and use it in GitHub Desktop.
Genesis: Header with Split Menu
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Header with Split Menu | |
*/ | |
//* 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 '<a href="' . get_bloginfo( 'url' ) . '"><img class="aligncenter" src="http://dev.targetimc.com/wp-content/themes/targetimc-basic/images/logo.png" /></a>'; | |
// wp_nav_menu( | |
// array( | |
// 'menu' => 'Contributors', | |
// 'container' => 'nav', | |
// 'menu_class' => 'genesis-nav-menu' | |
// ) | |
// ); | |
genesis_nav_menu( array( | |
'theme_location' => 'header', | |
'menu_class' => 'menu genesis-nav-menu', | |
) ); | |
} | |
else { | |
$divider_html = '<a href="' . get_bloginfo( 'url' ) . '"><img src="http://dev.targetimc.com/wp-content/themes/targetimc-basic/images/logo.png" /></a>'; | |
wp_nav_menu( | |
array( | |
// 'menu' => 'Contributors', | |
'theme_location' => 'header', | |
'divider_html' => $divider_html, | |
'container' => 'nav', | |
'menu_class' => 'genesis-nav-menu' | |
) | |
); | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Header with Split Menu | |
*/ | |
.site-header { | |
min-height: 0; | |
} | |
.menu-divider-item { | |
display: inline-block; | |
text-align: left; | |
} | |
.menu-divider-item img { | |
vertical-align: middle; | |
} | |
.menu-divider-item a { | |
padding-top: 0; | |
padding-bottom: 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment