Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Support Zafer – WPMU DEV Support

    (@wpmudevsupport15)

    Hi @sayandutta,

    I hope you are doing well today!

    This can be achieved using mu-plugins to exclude single or multiple images which you can see the examples below, as well as the information about how to use mu-plugins.

    https://wpmudev.com/docs/wpmu-dev-plugins/smush/#lazy-loading-filters
    https://wpmudev.com/docs/using-wordpress/installing-wordpress-plugins/#installing-mu-plugins

    Please let us know if you need further help.

    Kind regards,
    Zafer

    Thread Starter Sayan Dutta

    (@sayandutta)

    I dont wanna use another plugin for that. Just give me the class name of the first image and i will add it on the smush exclude option.

    Plugin Support Zafer – WPMU DEV Support

    (@wpmudevsupport15)

    Hi again @sayandutta,

    I am afraid, you don’t have a specific class or id to be used for the mentioned image. So, adding its current class will also interfere with other images on the site as well.
    Mu-plugins are generally used to change and trigger some options of the already installed plugins. You can use them to exclude this image by specifying it full path such as;

    <?php
    add_filter('smush_skip_image_from_lazy_load', function( $skip, $src, $image ){
    	//compare the $src here and return true to skip
    	if ( ! $skip && 'https://findnewscholarships.com/wp-content/uploads/2022/07/Case-Study-1-768x512.jpeg' === $src ) {
    		$skip = true;
    	}
    	return $skip;
    }, 99, 3);

    Another way to do is to create an id or custom class for this image on your page designer and use that on Smush Lazy Load exclusion section.

    Kind regards,
    Zafer

    Thread Starter Sayan Dutta

    (@sayandutta)

    For that also I will not be able to exclude the first image from lazy loading. You should add this functionality in the plugin itself because it’s an issue detected by Google itself. So the plugin should have this functionality by default.

    Plugin Support Kris – WPMU DEV Support

    (@wpmudevsupport13)

    Hi @sayandutta

    The first image from lazy loading is for sure related to image above the fold reported by google. Smush does not know what is above the fold and what not, as that is only known in the web browser and that is what google reports. That is why the solution for those cases is to use a mu-plugin or add ID/class for that image so it could be excluded from lazyload.

    Kind Regards,
    Kris

    Plugin Support Amin – WPMU DEV Support

    (@wpmudev-support2)

    Hello @sayandutta ,

    We haven’t heard from you for over a week now, so it looks like you don’t need our assistance anymore.

    Feel free to re-open this ticket if needed.

    Kind regards
    Kasia

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Stop Lazy loading First Image’ is closed to new replies.