Skip to content

Instantly share code, notes, and snippets.

@debonx
Last active September 5, 2021 12:05
Show Gist options
  • Save debonx/e320b281077bb9787444b88cc4ab76ee to your computer and use it in GitHub Desktop.
Save debonx/e320b281077bb9787444b88cc4ab76ee to your computer and use it in GitHub Desktop.
WooCommerce snippet to customise Single Product image thumbs.
<?php /**
* Single Product Thumbnails
*
* @param array $args
* @param int $attachment_id
* @param string $image_size
* @param bool $main_image
* @return array
*/
function bones_gallery_image_html_attachment_image_params ( $args, $attachment_id, $image_size, $main_image )
{
$args['class'] = esc_attr( $main_image ? 'wp-post-image' : 'wp-post-image-thumb' );
return $args;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment