Genesis show featured image on post page as background image
// Custom post featured image block
add_action( 'genesis_after_header', 'eia_post_page_header' );
function eia_post_page_header() {
if (!is_singular('post')) {
return;
}
if (!has_post_thumbnail()) {
// Display a default featured image if one isn't set
?>
<div class="eia-featured-image" style="background-image: url(/wp-content/themes/eia/img/blog-default-image.jpg); background-attachment: inherit">
<div class="image-overlay"></div>
<div class="title-wrap">
<?php genesis_do_post_title(); ?>
<svg xmlns="http://www.w3.org/2000/svg" xml:space="preserve" height="60px" viewBox="0 0 47 47" width="60px" version="1.1" y="0px" x="0px" xmlns:xlink="http://www.w3.org/1999/xlink" enable-background="new 0 0 47 47">
<path d="m47 23.5c0 13-10.5 23.5-23.5 23.5s-23.5-10.5-23.5-23.5 10.5-23.5 23.5-23.5 23.5 10.5 23.5 23.5z" fill="#fff"/>
<path d="m37 17.6c-0.742-1.78-1.75-3.3-3.04-4.56-1.29-1.29-2.84-2.23-4.62-2.91-0.326-0.13-0.682-0.228-1.04-0.324v5.05c0.775 0.421 1.45 0.971 2.04 1.62 0.842 0.874 1.49 1.94 1.94 3.1 0.452 1.2 0.681 2.49 0.681 3.85 0 1.49-0.229 2.85-0.681 4.08-0.452 1.26-1.1 2.33-1.94 3.23-0.808 0.906-1.81 1.62-2.98 2.13-1.17 0.52-2.46 0.778-3.88 0.778s-2.72-0.259-3.85-0.778c-1.17-0.516-2.17-1.23-2.97-2.13-0.844-0.905-1.49-1.97-1.94-3.23-0.455-1.23-0.681-2.59-0.681-4.08 0-1.36 0.226-2.65 0.681-3.85 0.451-1.16 1.1-2.23 1.94-3.1 0.58-0.646 1.29-1.2 2.07-1.65v-4.97c-0.389 0.098-0.775 0.228-1.13 0.389-1.78 0.681-3.3 1.65-4.56 2.91-1.29 1.26-2.3 2.81-3.01 4.59-0.744 1.81-1.1 3.82-1.1 6.02 0 2.14 0.355 4.11 1.1 5.86 0.713 1.75 1.72 3.26 3.01 4.53 1.26 1.26 2.78 2.23 4.56 2.91s3.72 1.04 5.85 1.04c2.14-0.031 4.11-0.42 5.89-1.13 1.78-0.713 3.33-1.68 4.62-2.94 1.3-1.29 2.3-2.78 3.04-4.56 0.713-1.75 1.07-3.72 1.07-5.85 0.1-2.2-0.3-4.2-1-6" fill="#C49215"/>
<path d="m25.9 6.07c-0.809-0.097-1.65-0.129-2.48-0.129-0.841 0-1.62 0.064-2.4 0.16v4.56l-0.002 7.82h4.88l0.003-7.82v-4.63z" fill="#C49215"/>
</svg>
</div>
</div>
<?php
}
if (has_post_thumbnail()) {
// Display featured image
?>
<div class="eia-featured-image" style="background-image: url(<?php echo genesis_get_image(array('format' => 'url')); ?>)">
<div class="image-overlay"></div>
<div class="title-wrap">
<?php genesis_do_post_title(); ?>
<svg xmlns="http://www.w3.org/2000/svg" xml:space="preserve" height="60px" viewBox="0 0 47 47" width="60px" version="1.1" y="0px" x="0px" xmlns:xlink="http://www.w3.org/1999/xlink" enable-background="new 0 0 47 47">
<path d="m47 23.5c0 13-10.5 23.5-23.5 23.5s-23.5-10.5-23.5-23.5 10.5-23.5 23.5-23.5 23.5 10.5 23.5 23.5z" fill="#fff"/>
<path d="m37 17.6c-0.742-1.78-1.75-3.3-3.04-4.56-1.29-1.29-2.84-2.23-4.62-2.91-0.326-0.13-0.682-0.228-1.04-0.324v5.05c0.775 0.421 1.45 0.971 2.04 1.62 0.842 0.874 1.49 1.94 1.94 3.1 0.452 1.2 0.681 2.49 0.681 3.85 0 1.49-0.229 2.85-0.681 4.08-0.452 1.26-1.1 2.33-1.94 3.23-0.808 0.906-1.81 1.62-2.98 2.13-1.17 0.52-2.46 0.778-3.88 0.778s-2.72-0.259-3.85-0.778c-1.17-0.516-2.17-1.23-2.97-2.13-0.844-0.905-1.49-1.97-1.94-3.23-0.455-1.23-0.681-2.59-0.681-4.08 0-1.36 0.226-2.65 0.681-3.85 0.451-1.16 1.1-2.23 1.94-3.1 0.58-0.646 1.29-1.2 2.07-1.65v-4.97c-0.389 0.098-0.775 0.228-1.13 0.389-1.78 0.681-3.3 1.65-4.56 2.91-1.29 1.26-2.3 2.81-3.01 4.59-0.744 1.81-1.1 3.82-1.1 6.02 0 2.14 0.355 4.11 1.1 5.86 0.713 1.75 1.72 3.26 3.01 4.53 1.26 1.26 2.78 2.23 4.56 2.91s3.72 1.04 5.85 1.04c2.14-0.031 4.11-0.42 5.89-1.13 1.78-0.713 3.33-1.68 4.62-2.94 1.3-1.29 2.3-2.78 3.04-4.56 0.713-1.75 1.07-3.72 1.07-5.85 0.1-2.2-0.3-4.2-1-6" fill="#C49215"/>
<path d="m25.9 6.07c-0.809-0.097-1.65-0.129-2.48-0.129-0.841 0-1.62 0.064-2.4 0.16v4.56l-0.002 7.82h4.88l0.003-7.82v-4.63z" fill="#C49215"/>
</svg>
</div>
</div>
<?php
}
}