• Resolved daliasued

    (@daliasued)


    Hello,

    Thank you for your beautiful plugin.

    I installed the plugin yesterday for my test site, but it happens to me that when I do a filter the images are not displayed, unless I refresh the page with F5. I use JetPack’s Lazy Load, I don’t know if this affects your plugin.

    Thank you,

    Dalia

    The page I need help with: [log in to see the link]

Viewing 2 replies - 1 through 2 (of 2 total)
  • Hi there,

    Please add the following PHP in the functions.php file of your current theme and then check if the issue is solved:

    if ( ! function_exists( 'yith_wcan_jetpack_lazy_load_fix' ) ) {
    	function yith_wcan_jetpack_lazy_load_fix() {
    		if ( class_exists( 'Jetpack' ) ) {
    			$js = "
    			jQuery( document ).on( 'yith-wcan-ajax-filtered', function (){
    				const elem = document.querySelector( 'body' );
    				const jetpackLazyImagesLoadEvent = new Event( 'jetpack-lazy-images-load' );
    				elem.dispatchEvent(jetpackLazyImagesLoadEvent);
    			});
    			";
    			wp_add_inline_script( 'yith-wcan-shortcodes', $js );
    		}
    	}
    	add_action( 'wp_enqueue_scripts', 'yith_wcan_jetpack_lazy_load_fix', 20 );
    }

    Let us know if this helped you.

    Thread Starter daliasued

    (@daliasued)

    Hi @aranofacundo yes it work, thank you so much.

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

The topic ‘Images don’t load’ is closed to new replies.