Last active
December 15, 2015 00:39
-
-
Save braddalton/5174955 to your computer and use it in GitHub Desktop.
Display featured image after title but before content on single posts. Change the genesis_hook to your own theme specific hook if needed. You can also change the conditional tag if needed.
This file contains hidden or 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_action( 'genesis_after_post_title', 'wpsites_after_post_title_featured_image' ); | |
function wpsites_after_post_title_featured_image() { | |
if ( is_single() ) return; | |
if ( $image = genesis_get_image( 'format=url&size=post-image' ) ) { | |
printf( '<a href="%s" rel="bookmark"><img class="post-photo" src="%s" alt="%s" /></a>', 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