Last active
September 21, 2015 14:19
-
-
Save tomfinitely/0489819352c8fe04830e to your computer and use it in GitHub Desktop.
Genesis Featured Video Thumbnails for Single Pages
This file contains hidden or 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
//* Featured Videos for Single Entries | |
add_action( 'genesis_before_entry', 'featured_video_plus_single_page_override', 9 ); | |
function featured_video_plus_single_page_override( $output ){ | |
$image_args = array( | |
'size' => 'large', | |
'attr' => array( | |
'class' => 'alignnone featured-image', | |
), | |
); | |
if( is_singular( array( 'post', 'page' ) ) && function_exists('has_post_video') && has_post_video()) { | |
return the_post_video(); | |
} else { | |
return genesis_image( $image_args ); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment