Skip to content

Instantly share code, notes, and snippets.

@srikat
Created May 9, 2014 12:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save srikat/38e27262e79092549103 to your computer and use it in GitHub Desktop.
Save srikat/38e27262e79092549103 to your computer and use it in GitHub Desktop.
Display Featured Image (if present) above the Content for Posts in Posts page.
//* Add new image size for Featured images on Posts page
add_image_size( 'posts-page', 680, 300, true );
add_action( 'genesis_entry_content', 'sk_show_featured_image_posts_page', 9 );
/**
* Display Featured Image (if present) above the Content for Posts in Posts page.
*
* @author Sridhar Katakam
* @link http://sridharkatakam.com/
*/
function sk_show_featured_image_posts_page() {
$image = genesis_get_image( 'format=url&size=posts-page' );
if ( is_home() && $image ) {
printf( '<div class="posts-page-image"><a href="%s" rel="bookmark"><img src="%s" alt="%s" /></a></div>', get_permalink(), $image, the_title_attribute( 'echo=0' ) );
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment