Skip to content

Instantly share code, notes, and snippets.

@reasonstousegenesis
Created May 15, 2015 11:07
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 reasonstousegenesis/7ef8dc25b9f98e88e2ee to your computer and use it in GitHub Desktop.
Save reasonstousegenesis/7ef8dc25b9f98e88e2ee to your computer and use it in GitHub Desktop.
Rewritten version of genesis_do_post_image from Going Green Pro
<?php
// Rewritten version of genesis_do_post_image from Going Green Pro
// functions.php
//* Remove default post image
remove_action( 'genesis_entry_content', 'genesis_do_post_image', 8 );
//* Add featured image above the entry content
add_action( 'genesis_entry_header', 'going_green_featured_photo', 5 );
function going_green_featured_photo() {
if ( is_page() || ! genesis_get_option( 'content_archive_thumbnail' ) )
return;
if ( $image = genesis_get_image( array( 'format' => 'url', 'size' => genesis_get_option( 'image_size' ) ) ) ) {
printf( '<div class="featured-image"><img src="%s" alt="%s" /></div>', $image, the_title_attribute( 'echo=0' ) );
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment