Skip to content

Instantly share code, notes, and snippets.

@jeffreyd00
Forked from srikat/functions.php
Created September 28, 2015 17:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jeffreyd00/8663efb8ef9a592fb486 to your computer and use it in GitHub Desktop.
Save jeffreyd00/8663efb8ef9a592fb486 to your computer and use it in GitHub Desktop.
Full width header with logo at left and navigation at right in Dynamik. http://sridharkatakam.com/full-width-header-logo-left-navigation-right-dynamik/
/**********************************
*
* Replace Header Site Title with Inline Logo
* Fix Genesis bug - when using static front page and blog page (admin reading settings) Home page is <p> tag and Blog page is <h1> tag
* Replace "is_home" with "is_front_page" to correctly display Home page wit <h1> tag and Blog page with <p> tag
*
* @author AlphaBlossom / Tony Eppright
* @link http://www.alphablossom.com
*
************************************/
add_filter( 'genesis_seo_title', 'abte_header_inline_logo', 10, 3 );
function abte_header_inline_logo( $title, $inside, $wrap ) {
$logo = '<img src="http://genesis.dev/wp-content/uploads/dynamik-gen/theme/images/251x46logo.gif" alt="' . esc_attr( get_bloginfo( 'name' ) ) . '">';
$inside = sprintf( '<a href="%s" title="%s">%s</a>', trailingslashit( home_url() ), esc_attr( get_bloginfo( 'name' ) ), $logo );
//* Determine which wrapping tags to use - changed is_home to is_front_page to fix Genesis bug
$wrap = is_front_page() && 'title' === genesis_get_seo_option( 'home_h1_on' ) ? 'h1' : 'p';
//* A little fallback, in case an SEO plugin is active - changed is_home to is_front_page to fix Genesis bug
$wrap = is_front_page() && ! genesis_get_seo_option( 'home_h1_on' ) ? 'h1' : $wrap;
//* And finally, $wrap in h1 if HTML5 & semantic headings enabled
$wrap = genesis_html5() && genesis_get_seo_option( 'semantic_headings' ) ? 'h1' : $wrap;
return sprintf( '<%1$s %2$s>%3$s</%1$s>', $wrap, genesis_attr( 'site-title' ), $inside );
}
// Remove 'header' from structural wrap
add_theme_support( 'genesis-structural-wraps', array(
'nav',
'subnav',
'site-inner',
'footer-widgets',
'footer'
) );
.site-header {
min-height: 0;
background: #ddf9e0;
border-bottom: 2px solid #b2ce96;
}
.title-area {
width: auto;
padding-left: 8px;
padding-top: 8px;
}
.site-title {
float: left;
margin-right: 20px;
}
.site-title a img {
vertical-align: top;
}
.site-description {
float: left;
margin-top: 12px;
color: #71868f;
}
.site-header .widget-area {
padding-top: 0;
width: auto;
}
.site-header .genesis-nav-menu {
width: auto;
}
.site-header .genesis-nav-menu a {
color: #20AE31;
font-weight: bold;
padding: 23px 15px;
}
.site-header .genesis-nav-menu li {
border-left: 1px solid #b2ce96;
float: left;
}
.site-header .genesis-nav-menu li li {
border-left: none;
}
.site-header .genesis-nav-menu li li a {
font-weight: normal;
}
/* li#menu-item-60 ul { // Uncomment if the last menu item has a sub menu. This makes the submenu appear left instead of right. Change the ID.
right: 0;
}
li#menu-item-60 li ul {
right: 201px;
} */
@media only screen and (max-width: 1140px) {
.site-description {
display: none;
}
.site-title {
margin-right: 0;
float: none;
}
.title-area {
height: auto;
}
.site-header .widget-area {
display: table;
margin: 0 auto;
}
.site-header .genesis-nav-menu li {
border-left: none;
}
/* li#menu-item-60 ul, // Uncomment if the last menu item has a sub menu. This makes the submenu appear left instead of right. Change the ID.
li#menu-item-60 li ul{
right: auto;
} */
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment