Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Support Williams – WPMU DEV Support

    (@wpmudev-support8)

    Hi @promz

    I hope you’re having a nice day!

    The LazyLoad feature can be set to skip selected classes and/or IDs. By default, you can add any class/ID to the “Classes & IDs” option on “Lazy Load” configuration page in the plugin. This can be any class/ID that’s specific to your gallery images.

    There’s no any specific class that Smush “Lazy Load” would ignore “by default”, though. At the current state, you’d rather want to use some class that’s very specific and instruct users to add it to Smush. However, there’s also a filter that, I believe, you could use in your code to make Smush Lazy Load just skip your gallery images:

    apply_filters( 'smush_skip_image_from_lazy_load', false, $src )

    You’ll find the context of that filter in the “/wp-smush/core/modules/class-wp-smush-lazy-load.php” file of the plugin, around line 350.

    Best regards,
    Adam

    Thread Starter Pramod Jodhani

    (@promz)

    Hello Adam,

    I read the code in the file “/wp-smush/core/modules/class-wp-smush-lazy-load.php” and figured that adding class no-lazyload will result in that image being ignored. Putting it here so that it can be helpful for others as well.

    Thanks for pointing me in the right direction.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Disable lazyload for certain images’ is closed to new replies.