Skip to content

Instantly share code, notes, and snippets.

@billerickson
Created November 12, 2012 14:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save billerickson/4059773 to your computer and use it in GitHub Desktop.
Save billerickson/4059773 to your computer and use it in GitHub Desktop.
/**
* Post Image
*
*/
function be_post_image() {
if ( ! is_singular() && genesis_get_option( 'content_archive_thumbnail' ) ) {
$class = in_array( 'one-third', get_post_class() ) ? 'aligncenter post-image' : 'alignnone post-image';
$img = genesis_get_image( array( 'format' => 'html', 'size' => genesis_get_option( 'image_size' ), 'attr' => array( 'class' => $class ) ) );
printf( '<a href="%s" title="%s">%s</a>', get_permalink(), the_title_attribute( 'echo=0' ), $img );
}
}
add_action( 'genesis_post_content', 'be_post_image' );
remove_action( 'genesis_post_content', 'genesis_do_post_image' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment