• We’re using Autoptimize with the lazy load setting, but the before/after images have
    data-no-lazy="1" data-skip-lazy="1" which prevents them from obeying my lazy load settings. Is there a way to turn that off? Or is there way to defer loading them?

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author Bolton Studios LLC

    (@boltonstudios)

    @dickraney Lazy loading doesn’t seem to work properly with the underlying open source script that this plugin uses: TwentyTwenty by ZURB. The images often fail to appear at all after lazy loading hides them, and that issue was a frequent complaint in support threads for this plugin at one time. Therefore, the plugin now opts-out of lazy loading features on the before + after sliders where possible. I can tell you where to manually edit the plugin files to remove those ‘skip-lazy’ attributes if you want to test it out (let me know). I will also consider adding an option to disable the skip-lazy attributes via plugin settings but I don’t have an ETA on that.

    Thread Starter DickRaney

    (@dickraney)

    Okay, tell me where to edit the plugin files.

    Thanks!

    Plugin Author Bolton Studios LLC

    (@boltonstudios)

    @dickraney In /wp-content/plugins/before-after-images-for-divi/includes/modules/BeforeAfterImages/BeforeAfterImages.php, change the following code on line 506 from:

    $lazy_load_attr = 'data-skip-lazy="1" data-no-lazy="1"';

    …to…

    $lazy_load_attr = '';

    Then, be sure to clear any caches such as the Divi cache. You can click Divi > Theme Options > Save Changes to clear the Divi cache. Saving changes will clear the cache. Please let me know if that is helpful.

    Note, this may cause your before + after sliders to disappear because the lazy load plugins will hide the images. Also, since this is a manual plugin edit, any future updates of this plugin through the WordPress Dashboard will overwrite the edits on your copy of the plugin.

    Plugin Author Bolton Studios LLC

    (@boltonstudios)

    @dickraney Also on line 624 change the code from:

    esc_attr( $imageClass[ $i ] . ' skip-lazy' ),

    …to…

    esc_attr( $imageClass[ $i ] . '' ),

    Thread Starter DickRaney

    (@dickraney)

    How is all of this affected by the new WordPress lazy load feature?

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Images are not lazy loading’ is closed to new replies.