Skip to content

Instantly share code, notes, and snippets.

@srikat
Last active March 21, 2017 13:36
Show Gist options
  • Save srikat/8469087 to your computer and use it in GitHub Desktop.
Save srikat/8469087 to your computer and use it in GitHub Desktop.
Primary Nav on left, Site Title or Logo in the middle and Secondary Nav on right in Genesis. http://sridharkatakam.com/primary-nav-left-site-title-logo-middle-secondary-nav-right-genesis/
//* Remove the default header
remove_action( 'genesis_header', 'genesis_do_header' );
//* Add Primary Nav in custom header
add_action( 'genesis_header', 'genesis_do_nav' );
//* Add Site Title in custom header
add_action( 'genesis_header', 'sk_do_header' );
function sk_do_header() {
do_action( 'genesis_site_title' );
// do_action( 'genesis_site_description' );
}
//* Add Secondary Nav in custom header
add_action( 'genesis_header', 'genesis_do_subnav' );
//* Remove Primary and Secondary Nav from below header
remove_action( 'genesis_after_header', 'genesis_do_nav' );
remove_action( 'genesis_after_header', 'genesis_do_subnav' );
/*
Primary Nav on left, Site Title or Logo in the middle and Secondary Nav on right
--------------------------------------------------------------------------------- */
.header-image .site-header .wrap {
background: transparent;
}
.header-image .site-description, .header-image .site-title a {
text-indent: 0;
}
.header-image .site-title a {
min-height: 0;
}
.site-header .nav-primary {
width: 38%;
float: left;
margin-right: 4%;
}
.site-header .site-title {
float: left;
width: 16%;
margin-right: 4%;
margin-top: 2.5rem;
}
.site-header .nav-secondary {
width: 38%;
float: right;
}
.nav-primary {
background-color: transparent;
}
.nav-primary a:hover, .nav-primary .current-menu-item > a {
color: #333;
}
.nav-secondary .wrap {
float: right;
}
@media only screen and (max-width: 1024px) {
.site-header .nav-primary {
float: none;
width: 100%;
margin-right: 0;
}
.site-header .site-title {
float: none;
width: 100%;
margin-top: 0;
overflow: hidden;
margin-right: 0;
}
.site-header .nav-secondary {
float: none;
width: 100%;
}
.site-header .wrap {
padding: 20px 0;
padding: 2rem 0;
}
.header-image .site-header .wrap {
background-position: center top;
}
.site-header {
padding: 0;
}
.genesis-nav-menu li,
.site-header ul.genesis-nav-menu,
.site-header .search-form {
float: none;
}
.genesis-nav-menu,
.site-description,
.site-header .title-area,
.site-header .search-form,
.site-title {
text-align: center;
}
.genesis-nav-menu a,
.genesis-nav-menu > .first > a,
.genesis-nav-menu > .last > a {
padding: 20px 16px;
padding: 2rem 1.6rem;
}
.site-header .search-form {
margin: 16px auto ;
margin: 1.6rem auto;
}
.genesis-nav-menu li.right {
display: none;
}
.nav-secondary .wrap {
float: none;
}
}
/*
Primary Nav on left, Site Title or Logo in the middle and Secondary Nav on right
--------------------------------------------------------------------------------- */
.header-image .site-header .wrap {
background: transparent;
}
.header-image .site-title a {
background: url("images/200x80.gif") no-repeat;
text-indent: -9999em;
width: 200px;
height: 80px;
}
.header-image .site-title a {
min-height: 0;
}
.site-header {
padding-top: 1rem;
padding-bottom: 1rem;
}
.site-header .nav-primary {
width: 38%;
float: left;
margin-right: 4%;
}
.site-header .site-title {
margin-bottom: 0;
}
.site-header .nav-secondary {
width: 38%;
float: right;
}
.nav-primary {
background-color: transparent;
}
.nav-primary a:hover, .nav-primary .current-menu-item > a {
color: #333;
}
.nav-secondary .wrap {
float: right;
}
@media only screen and (max-width: 1024px) {
.site-header .nav-primary {
float: none;
width: 100%;
margin-right: 0;
}
.site-header .site-title {
float: none;
width: 100%;
margin-top: 0;
overflow: hidden;
margin-right: 0;
}
.header-image .site-title a {
float: none;
margin: 0 auto;
}
.site-header .nav-secondary {
float: none;
width: 100%;
}
.site-header .wrap {
padding: 20px 0;
padding: 2rem 0;
}
.header-image .site-header .wrap {
background-position: center top;
}
.site-header {
padding: 0;
}
.genesis-nav-menu li,
.site-header ul.genesis-nav-menu,
.site-header .search-form {
float: none;
}
.genesis-nav-menu,
.site-description,
.site-header .title-area,
.site-header .search-form,
.site-title {
text-align: center;
}
.genesis-nav-menu a,
.genesis-nav-menu > .first > a,
.genesis-nav-menu > .last > a {
padding: 20px 16px;
padding: 2rem 1.6rem;
}
.site-header .search-form {
margin: 16px auto ;
margin: 1.6rem auto;
}
.genesis-nav-menu li.right {
display: none;
}
.nav-secondary .wrap {
float: none;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment