Skip to content

Instantly share code, notes, and snippets.

@SeanChDavis
Last active August 29, 2015 14:05
Show Gist options
  • Select an option

  • Save SeanChDavis/3f306e53d940ea248712 to your computer and use it in GitHub Desktop.

Select an option

Save SeanChDavis/3f306e53d940ea248712 to your computer and use it in GitHub Desktop.
EDD Download Thumbnail in Download Details Widget
function sd_edd_download_details_widget_thumbnail( $instance ) {
// get the ID of the current post
$post_id = get_the_ID();
// grab featured image of the appropriate download
if ( 'current' == $instance['download_id'] ) {
echo get_the_post_thumbnail( $post_id );
} else {
echo get_the_post_thumbnail( $instance['download_id'] );
}
}
add_action( 'edd_product_details_widget_before_purchase_button', 'sd_edd_download_details_widget_thumbnail' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment