• Resolved julien


    Hello I am back on this topic because it was working but now I have the same problem back with WP Rocket lazy load

    I have that code on function.php child theme:

    function dsm_rocket_lazyload_exclude_class( $attributes ) {
    		$attributes[] = 'class="dsm-before-after-image-slider-before"';
    		$attributes[] = 'class="dsm-before-after-image-slider-after"';
    		return $attributes;
    add_filter( 'rocket_lazyload_excluded_attributes', 'dsm_rocket_lazyload_exclude_class' );

    But now it not working. Maybe a Divi or WP Rocket update ?

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

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Supreme Modules



    It seems like the WP Rocket lazyload isn’t excluding this for some reason.

    For the time being, based on your image filename:

    You can use:

    function dsm_rocket_lazyload_exclude_src( $src ) {
    	$src[] = 'master_white_olenpack-r-24v';
    	$src[] = 'master_black_olenpack-r-48v';
    	return $src;
    add_filter( 'rocket_lazyload_excluded_src', 'dsm_rocket_lazyload_exclude_src' );

    We will most likely update the plugin soon to only execute the before/after images after it’s loaded.

    Plugin Author Supreme Modules


    updated the plugin to enhance this lazyload. Script will only execute into viewport.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘lazy load slider’ is closed to new replies.