Created
January 29, 2013 02:09
-
-
Save jamiemitchell/4661088 to your computer and use it in GitHub Desktop.
Add post image above post title in Genesis Framework
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
<?php | |
/* Add image above post title | |
------------------------------------------------------------ */ | |
add_action( 'genesis_before_post', 'jm_post_image' ); | |
function jm_post_image() { | |
if ( is_page() ) return; | |
if ( $image = genesis_get_image( 'format=url&size=post-image' ) ) { | |
printf( '<a href="%s"><img class="post-image alignleft" 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