Archived topic
Disable Lazy load above the fold
7 replies · Started by Sukalery on July 19, 2021
Hello,
How could I disable the featured image and site logo above the fold?
I tried David code here:
https://generatepress.com/forums/topic/high-lcp-loading-time/#post-1702740
but somehow it disables lazy loading for the second image on the mobile screen, not the first one.
Note: I use LiteSpeed cache plugin to lazy load all images.
Thank you.
Hi there,
You'll need to do that on Litespeed's UI.
I believe they have a lazy loading exclusion feature - https://docs.litespeedtech.com/lscache/lscwp/pageopt/#lazy-load-iframe-parent-class-name-excludes
You'll have to inspect the page and check the class name of the images (or the parent of the image) and include it on the exclusion field.
Hi Elvin, I see the classes in chrome inspecting tool:
Logo: is-logo-image LiteSpeed-loaded
First image: attachment-medium size-medium first-featured-image wp-post-image litespeed-loaded
but when I exclude it in LiteSpeed plugin, lazy loading stops working for all images, except the logo.
Hi there,
the code i provided in the other topic only applies to the Featured Images - it won't work with an Image that has been added in the Page/Post Editor content.
Instead you would need to select those images in the post editor, and in the Advanced > Additional CSS Class(es) field you can add your won CSS class eg. no-lazy
then you can add that class to the Litespeed Lazy load exclusions list.
alright, I will do that.
Edit: Can you tell what is the mobile logo default class?
Thank you.
All logos have the is-logo-image including the mobile header.
Thanks, David, have a good day.
Glad to be of help!