Skip to content

Instantly share code, notes, and snippets.

@srikat
Created November 17, 2013 05:58
Show Gist options
  • Save srikat/7509858 to your computer and use it in GitHub Desktop.
Save srikat/7509858 to your computer and use it in GitHub Desktop.
//* Add support for structural wraps
add_theme_support( 'genesis-structural-wraps', array(
'header',
'nav',
'subnav',
'site-inner',
'footer-widgets',
'footer',
'header-image'
) );
add_action ( 'genesis_before_header', 'sk_add_header_image' );
function sk_add_header_image() {
printf( '<div %s>', genesis_attr( 'header-image' ) );
genesis_structural_wrap( 'header-image' );
$header_image = sprintf( '<a href="%s" title="%s"><img src="'. get_stylesheet_directory_uri() .'/images/header.jpg" title="%s" alt="%s"/></a>', trailingslashit( home_url() ), esc_attr( get_bloginfo( 'name' ) ), esc_attr( get_bloginfo( 'name' ) ), esc_attr( get_bloginfo( 'name' ) ) );
echo $header_image;
genesis_structural_wrap( 'header-image', 'close' );
echo '</div>';
}
.header-image {
margin-top: 4rem;
margin-bottom: 4rem;
text-align: center;
}
.header-image img {
margin-bottom: 0;
vertical-align: top;
}
@media only screen and (max-width: 320px) {
.header-image {
margin-top: 2rem;
margin-bottom: 2rem;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment