• Resolved Dan14

    (@dan14)


    I want to give your plugin a shot. I would like to know whether it is possible to exclude certain images from lazy load and if yes how to do it?

    My second question is if its possible to limit lazy load only to mobile devices?

    Thanks in advance.

    • This topic was modified 5 years, 5 months ago by Dan14.
Viewing 5 replies - 1 through 5 (of 5 total)
  • Andy

    (@andywpmudev)

    Hi @dan14

    Yes, you most absolutely can :). You can exclude by post type, page/post ID or right down to the image using CSS classes and IDs. You’ll find all of these settings on the Lazy Load tab within the Smush Settings area.

    I will ping our lead developer for some input on the mobile-only lazy loading… I don’t believe it’s possible via the UI at the moment but it may be workable with a bit of code.

    Expect a reply from Anton shortly :).

    Cheers,
    Andy

    Thread Starter Dan14

    (@dan14)

    Thank you for your reply.

    My main issue is with mobile/tablets/ipads and not desktops. I hope this can be achieved so I’m looking to hear from you. I may be able to just disable the plugin on desktops so that might work but I’ll wait for the Anton’s reply.

    Just another small question on the above, I noticed the images only load upon view. Is it possible instead to load the images ‘after all critical resources have finished loading?’

    • This reply was modified 5 years, 5 months ago by Dan14.

    Hi @dan14,

    Smush has the mobile detection mechanisms in place, but we’re not utilizing them to exclude pages in that way. Would you mind sharing a reason why you want lazy loading disabled on mobile?

    Regarding the loading after all critical resources have loaded – I can only think of one possible work around – triggering the lazy loading early. For example, instead of lazy loading an image once the user scrolls to it, it’s loaded when the user is 500-600px (or whatever) above the image, so by the time the user scrolls to the image – it’s already there.

    Best regards,
    Anton

    Thread Starter Dan14

    (@dan14)

    Hi Anton,

    Thank you for your reply.

    Regarding the mobile phone, I do want lazy load on mobile/tablets only, not in desktops/ In desktops my pages are fast enough due the CDN I am using. On mobiles despite the CDN it can be faster with lazy load. It should save me 1.2 seconds on the homepage.

    If I can get lazy load to trigger early as you wrote it will be better, I would rather the user to see the images before they are being viewed and not n view.

    How do I do this workaround so all images are loaded once the critical resources has been loaded?

    @dan14 ,

    We never really had requests to disable some feature because the site was working too fast. But, I guess, if you really want to do that, you can add this to your themes functions.php file:

    if ( ! wp_is_mobile() ) {
        apply_filters( 'wp_smush_should_skip_parse', '__return_true' );
    }

    That should disable lazy loading on desktops.

    Best regards,
    Anton

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Excluding some images from lazy load’ is closed to new replies.