Skip to content

Instantly share code, notes, and snippets.

@pelmered
Last active August 29, 2015 13:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pelmered/9d9652688c4215700794 to your computer and use it in GitHub Desktop.
Save pelmered/9d9652688c4215700794 to your computer and use it in GitHub Desktop.
Replace fullsize image when thumbnail is clicked in WooCommerce/Wordpress
jQuery(function($){
$('.thumbnails>a>img').click(function(e){
e.stopPropagation();
$('.woocommerce-main-image img').attr('src', $(this).attr('src').replace('-87x87','-564x564'));
return false;
});
});
@pelmered
Copy link
Author

Replace -87x87 and -564x564 with your specific image sizes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment