patric-boehner
8/16/2016 - 9:12 AM

Display featured image at the top of single posts in Genesis.

Display featured image at the top of single posts in Genesis.

<?php
//* Do NOT include the opening php tag shown above. Copy the code shown below.


//* Add Featured Image Before Content

/*
 * If Before Content is not the right location to
 * achive full width than play with other Genesis hooks.
 * Take a look at, https://my.studiopress.com/docs/hook-reference/
*/

add_action( 'genesis_before_content', 'pb_featured_post_image' );
function pb_featured_post_image() {

	if ( has_post_thumbnail() ) {
	  // The figure element is optional, its just for added structure
		echo '<figure class="featured-image">';
		the_post_thumbnail( 'the_size_you_need' );
		echo '</figure>';
	}
	
}