Here is a really useful piece of code that you can use to reposition the feature image or insert a feature image into your Genesis theme pages.
The code below will position the image under your page title or over it. If we are talking Genesis hooks then we are positioning genesis_before_entry_content or genesis_before_entry.
Make sure that you have a back-up of your function.php file and access to your web hosting control panel of FTP. If you make a mistake you may white screen your website - front and dashboard. You need to be able to put that file back if you go wrong.
The first thing that you need to do is create the correct size feature image size. I have used the code below in the Altitude Pro Theme. The content area with a sidebar is 700px and I want a nice slim image so 200px is plenty.
//* Add new image sizes
add_image_size( 'featured-page', 1140, 400, TRUE );
and change to
//* Add new image sizes
add_image_size( 'featured-page', 1140, 400, TRUE );
add_image_size( 'featured-image', 700, 200, TRUE );
This new image size will only be created for new images so if you are looking to re-size old image you will need to use a re-sizing plugin. Regenerate Thumbnails is the one we use here.
Next step is to add the code that will control the output of the feature image.
To place the feature image below your Genesis entry title:
//* Add feature image under entry header
add_action( 'genesis_before_entry_content', 'featured_post_image', 8 );
function featured_post_image() {
if ( ! is_singular( 'page' ) ) return;
the_post_thumbnail('post-image');
}
To place the feature image above your Genesis entry title:
//* Add feature image under entry header
add_action( 'genesis_before_entry', 'featured_post_image', 8 );
function featured_post_image() {
if ( ! is_singular( 'page' ) ) return;
the_post_thumbnail('post-image');
}
You may need to adjust your CSS to ensure margins are correct
And there you have it...