add_action( 'genesis_after_header', 'cover_image' );
function cover_image() {
// if we are not on a single page, abort.
if ( !is_singular( 'page' ) ) {
return;
}
if ( has_post_thumbnail() ) {
$image = genesis_get_image( 'format=url&size=post-cover' );
?>
<div class="post-cover" style="background-image: url('<?php echo $image; ?>')">
</div>
<?php
}
}
if ( has_post_thumbnail() ) { ?>
<style>
.site-inner{margin-top:5px;}
.entry-title{padding-top: 30px;}
.content-sidebar-wrap{
margin-top: -120px;
background:white;
}
/* Post cover image */
.post-cover {
padding: 300px 0;
background-size: cover;
background-repeat: no-repeat;
background-position: center;
}
@media only screen and (max-width: 1023px) {
.post-cover .entry-title {
max-width: none;
}
}
</style>
<?php
}