Help Docs Software Kadence Kadence Iconic Kadence Iconic Linked Variations Change the Image Thumbnail Size

Change the Image Thumbnail Size

If you want to change the image size/crop used by Linked Variations, you can do so with this snippet.

By default it uses the shop_thumbnail size.

Add it to your theme’s functions.php file, or use a Code Snippets plugin.

/**
 * Iconic Linked Variations change the image size.
 *
 * @param string                             $size             Image size. Example 'thumbnail', 'large' etc.
 * @param WC_product                         $linked_variation The product object.
 * @param Iconic_WLV_Linked_Variations_Group $group            Linked Variation object.
 *
 * @return string
 */
function iconic_lv_change_image_size( $size, $linked_variation, $group ) {
    return 'large';
}

add_filter( 'iconic_wlv_linked_variation_image_size' , 'iconic_lv_change_image_size', 10, 3 );
Was this article helpful?