- This topic has 11 replies, 3 voices, and was last updated 3 years, 7 months ago by
Leo.
-
AuthorPosts
-
January 16, 2022 at 8:32 am #2082246
maxime
Hello,
I would like to not lazy load the first image (or featured image) on every page as I saw in this post.
So I copied and paste the PHP Snippet but it doesn’t work, I think I have to do something with the CSS but I didn’t understand how or where.The PHP Snippets is actually active, just to let you know.
If there’s another way to do it, please let me know too.
Thanks for your help.
January 16, 2022 at 11:07 am #2082396Leo
StaffCustomer SupportHi there,
That script is to add the class
first-featured-image
to the featured image and it’s indeed working:
https://www.screencast.com/t/tOQBBYrtmMKnThen you just need to add
first-featured-image
to the exclusion of whatever plugin you are using to perform lazy-load.The theme itself doesn’t have any lazy loading feature built-in so it must be from a plugin.
You can check with the plugin support for further info if needed.
January 18, 2022 at 10:20 am #2084925maxime
Hello Leo, sorry for the late reply I didn’t check back.
Thank you I understand now how the code works 🙂
I’m using imagify but I don’t see any lazy load option and for the plugin autoptimize, in the image section I didn’t check any box about image optimization nor the lazy load.
Which mean that I think my image are being lazy load automatically by WordPress now that they do that and we don’t need any plugin.
By any chance would you know how I can exclude then the first image lazy load not caused by a plugin?Thanks
January 18, 2022 at 11:19 am #2084989Ying
StaffCustomer SupportHi Maxime,
It looks like you are using WP fastest cache plugin, can you check if it has lazy load options?
And for Autoptimize, you can find its lazyload settings at settings > Autoptimize > images, you can see the exclusions options there.
January 18, 2022 at 11:25 am #2084996maxime
Hello Ying,
For WP fastest cache it’s unchecked and I can’t even check it cause I don’t have the premium plan haha
But for Autoptimize it means I would have to activate the lazy load to then exclude the classfirst-featured-image
?
Because right now my lazy load are just from WordPress itself.January 18, 2022 at 11:33 am #2085008Leo
StaffCustomer SupportBecause right now my lazy load are just from WordPress itself.
Hmm in that case can you check with WordPress’ support team to see if they can help to exclude certain images from being lazy loaded?
I did a quick research but can only find this:
https://www.wppagebuilders.com/disable-lazy-load-in-wordpress-5-5/January 18, 2022 at 11:37 am #2085015maxime
Understood Leo, thank you for your help.
And Ying to let you know that it’s working when autoptimize activated and the class Leo told me excluded.Anyway I looked in case of in your link.
Thank you both, have a nice day.
January 18, 2022 at 11:39 am #2085019Ying
StaffCustomer SupportYou can try a plugin to disable WordPress native lazy load: https://wordpress.org/plugins/disable-lazy-loading/
Or give this filter a try to disable WP lazy load:
add_filter( 'wp_lazy_loading_enabled', '__return_false' );
As it’s not a GP issue, it’s better to reach out to WP support.
I did some Googling, this article should be helpful: https://wphelp.blog/how-to-selectively-disable-lazy-load/
January 18, 2022 at 11:40 am #2085020maxime
Thank you Ying I’ll try that first 🙂
January 18, 2022 at 11:40 am #2085021Leo
StaffCustomer SupportAnd Ying to let you know that it’s working when autoptimize activated and the class Leo told me excluded.
Hmm in that case I would assume Autopimize is responsible for the lazy loading and not WordPress.
Glad to hear it’s working for you though!
January 18, 2022 at 11:44 am #2085030maxime
Yes I activated the lazy loading from autoptimize to try its exclusion, and it’s working 🙂
So I think I’ll have to disable the native lazy load from WordPressJanuary 18, 2022 at 11:45 am #2085032Leo
StaffCustomer SupportSounds good 🙂
-
AuthorPosts
- You must be logged in to reply to this topic.