Skip to content

Instantly share code, notes, and snippets.

@jamiemitchell
Created January 29, 2013 02:09
Show Gist options
  • Save jamiemitchell/4661088 to your computer and use it in GitHub Desktop.
Save jamiemitchell/4661088 to your computer and use it in GitHub Desktop.
Add post image above post title in Genesis Framework
<?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