You might have seen several blogs which displays full width image above the post title in all posts, This Insertion can be done with just few lines of code and user only have to set featured image for a post.
Here is a Genesis Framework Code snippet to display featured image with custom size size in all posts by default. Add the following snippet to your functions.php
file.
For Genesis HTML 5 Markup
/* Code to Display Featured Image on top of the post */ add_action( 'genesis_before_entry', 'featured_post_image', 8 ); function featured_post_image() { if ( ! is_singular( 'post' ) ) return; the_post_thumbnail('post-image'); }
Haven’t Purchased Genesis yet ? Download Genesis Framework 2 from here.
For Genesis XHTML markup (1.x and below)
/* Code to Display Featured Image on top of the post */ add_action( 'genesis_before_post', 'featured_post_image', 8 ); function featured_post_image() { if ( ! is_singular( 'post' ) ) return; the_post_thumbnail('post-image'); }
In above code post-image
represent featured image size.
/** Support for various Image sizes */ add_image_size('post-image', 600, 300, TRUE );
In above code 600 and 300 is a width and height of featured image respectively. Also don’t forget to regenerate thumbnails if you like to resize previous uploaded images.