Last active
September 14, 2017 13:33
-
-
Save robbm76/24f56d2279adec276a79609c4ee5df87 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 | |
/* Code to Display Featured Image on top of the post */ | |
add_action( 'genesis_before_entry', 'featured_post_image', 8 ); | |
function featured_post_image() { | |
if ( ! is_singular( 'post' ) ) return; | |
the_post_thumbnail('post-image'); | |
} |
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 | |
add_action( 'genesis_entry_header', 'featured_post_image', 8 ); | |
/** | |
* Conditionally add the post thumbnail to single post | |
*/ | |
function featured_post_image() { | |
if ( ! is_singular( 'post' ) ) | |
return; | |
if( ! function_exists( 'get_field' ) ) | |
return; | |
if ( get_field( 'show_image_single' ) ) { | |
the_post_thumbnail( 'post-image' ); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment