Title: Variant Image Not Loading
Last modified: January 27, 2022

---

# Variant Image Not Loading

 *  Resolved [Michele](https://wordpress.org/support/users/msustudio/)
 * (@msustudio)
 * [4 years, 3 months ago](https://wordpress.org/support/topic/variant-image-not-loading/)
 * When selecting a variant, the variant image only loads one pixel in height. We
   tried deactivating all plugins and changing themes. We thought maybe it was due
   to us not upgrading to WP 5.9, so we upgraded as well with no luck.
 * We tried this code as well from a previous topic, but does not do anything.
 *     ```
       function wgs_gallery_reset () { 
       	if( is_product() ) { ?>
       	<script>
       		(function($){
       			$(document).on('ready', function(){
   
       				$(document).on('change', '.variations select', function () {
       					setTimeout(function () { 
       						if( $('.wcgs-carousel .slick-list').outerHeight() == 1 ){
       							$('.wcgs-carousel').slick('refresh');
       						}
       					}, 300);
       				});
       			});
       		})(jQuery);
       	</script>
       	<?php  } 
       }
       add_action( 'wp_footer', 'wgs_gallery_reset', 99 );
       ```
   
    -  This topic was modified 4 years, 3 months ago by [Michele](https://wordpress.org/support/users/msustudio/).

Viewing 3 replies - 1 through 3 (of 3 total)

 *  Plugin Support [Bayejid Ahmed](https://wordpress.org/support/users/bayejid00/)
 * (@bayejid00)
 * [4 years, 3 months ago](https://wordpress.org/support/topic/variant-image-not-loading/#post-15304808)
 * Hi,
 * Sorry for the inconvenience.
 * We have noted the image loading issue in the development roadmap and it will 
   be resolved in the future version.
 * You may use the revised code in the current theme’s functions.php file.
 *     ```
       function wgs_gallery_reset_modified () { 
       	if( is_product() ) { ?>
       	<script>
       		(function($){
       			$(document).on('change', '.variations select', function () {
       				setTimeout(function () { 
       					if( $('.wcgs-carousel .slick-list').outerHeight() == 1 ){
       						$('.wcgs-carousel').slick('refresh');
       					}
       				}, 1500);
       			});
       		})(jQuery);
       	</script>
       	<?php  } 
       }
       add_action( 'wp_footer', 'wgs_gallery_reset_modified', 99 );
       ```
   
 * Let us know if it works or not. For further queries, create [a ticket here](https://shapedplugin.com/create-support-ticket/).
 *  Thread Starter [Michele](https://wordpress.org/support/users/msustudio/)
 * (@msustudio)
 * [4 years, 3 months ago](https://wordpress.org/support/topic/variant-image-not-loading/#post-15311603)
 * Increasing the timeout and removing document.load does the trick, but I also 
   found it loads with 0px at times. Here is the code that I have found to work 
   for me:
 *     ```
       function wgs_gallery_reset () { 
       	if( is_product() ) { ?>
       	<script>
       			(function($){
       			$(document).on('change', '.variations select', function () {
       				setTimeout(function () { 
       					if( $('.wcgs-carousel .slick-list').outerHeight() < 2 ){
       						$('.wcgs-carousel').slick('refresh');
       					}
       				}, 1000);
       			});
       		})(jQuery);
       	</script>
       	<?php  } 
       }
       add_action( 'wp_footer', 'wgs_gallery_reset', 99 );
       ```
   
 *  Plugin Support [Bayejid Ahmed](https://wordpress.org/support/users/bayejid00/)
 * (@bayejid00)
 * [4 years, 3 months ago](https://wordpress.org/support/topic/variant-image-not-loading/#post-15313541)
 * Hi [@msustudio](https://wordpress.org/support/users/msustudio/),
 * Thank you for your effort.

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Variant Image Not Loading’ is closed to new replies.

 * ![](https://ps.w.org/gallery-slider-for-woocommerce/assets/icon-256x256.gif?rev
   =3501541)
 * [Product Gallery Slider, Additional Variation Images, Product Video, Product Image Zoom and Lightbox for WooCommerce – WooGallery](https://wordpress.org/plugins/gallery-slider-for-woocommerce/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/gallery-slider-for-woocommerce/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/gallery-slider-for-woocommerce/)
 * [Active Topics](https://wordpress.org/support/plugin/gallery-slider-for-woocommerce/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/gallery-slider-for-woocommerce/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/gallery-slider-for-woocommerce/reviews/)

 * 3 replies
 * 2 participants
 * Last reply from: [Bayejid Ahmed](https://wordpress.org/support/users/bayejid00/)
 * Last activity: [4 years, 3 months ago](https://wordpress.org/support/topic/variant-image-not-loading/#post-15313541)
 * Status: resolved