Created
May 9, 2014 12:21
-
-
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.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//* 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