Created
May 1, 2015 04:20
-
-
Save nhatdongnguyen/d66c1583332f4fe363fa to your computer and use it in GitHub Desktop.
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 | |
// Register a custom image size for Singular Featured images | |
add_image_size( 'singular-featured-thumb', 800, 250, true ); | |
add_action( 'genesis_before_entry', 'sk_display_featured_image' ); | |
function sk_display_featured_image() { | |
if ( ! is_singular( array( 'post', 'page' ) ) ) { | |
return; | |
} | |
if ( ! has_post_thumbnail() ) { | |
return; | |
} | |
// Display featured image above content | |
echo '<div class="singular-featured-image">'; | |
genesis_image( array( 'size' => 'singular-featured-thumb' ) ); | |
echo '</div>'; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment