Created
May 15, 2015 11:07
-
-
Save reasonstousegenesis/7ef8dc25b9f98e88e2ee to your computer and use it in GitHub Desktop.
Rewritten version of genesis_do_post_image from Going Green Pro
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 | |
// 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