Skip to content

Instantly share code, notes, and snippets.

@aibrean
Created May 7, 2015 15:59
Show Gist options
  • Save aibrean/42e8adca10da301a4428 to your computer and use it in GitHub Desktop.
Save aibrean/42e8adca10da301a4428 to your computer and use it in GitHub Desktop.
Custom WooCommerce Lazy Load Product Thumbnail display.
function woocommerce_template_loop_product_thumbnail() {
$image_src = wp_get_attachment_image_src( get_post_thumbnail_id(),'full' );
echo '<img data-original="' . $image_src[0] . '" width="400" height="900" class="attachment-shop_catalog wp-post-image lazy"><noscript><img src="' . $image_src[0] . '" width="400" height="900" class="attachment-shop_catalog wp-post-image lazy"></noscript>';
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment