Hi Elraff
You should contact the your developer to add this custom php code into your template that page is using
Add below code before ‘the_content()’ or any code that you think it’s getting the content for show on your page
add_filter( 'a3_lazy_load_run_filter', 'skip_a3_lazy_load_for_this_page', 11 );
function skip_a3_lazy_load_for_this_page( $apply_lazyload ) {
$apply_lazyload = false;
return $apply_lazyload;
}
Regards,
Nguyen
Thread Starter
elraff
(@elraff)
Thanks Nguyen,
I think I could give it a try.
I have inactivated the plugin because in the practice I don’t see the other pages to lazy load.
Probably because all the images are within a single class and so all loaded at same time.
If i activate the plugin again, how can I test if is working or not for those pages?
rgds
Hi Elraff
If you put my code into correct page that want to skip lazy load for all images on that page then you can inspect element from browser to see the images on that page have class name like ‘lazy-loaded’ or no
Our plugin apply lazy load for image by add class ‘lazy-…’ to image like below screenshot
https://i.gyazo.com/9e93be32f928df7f0c143a5e3f37e9ae.png
If you don’t see it add any class ‘lazy-…’ to image then my custom php code is working for your page
Regards,
Nguyen
Thread Starter
elraff
(@elraff)
Thanks a lot,
So as expected, is not working for the images on my page.
Will talk with the template provider to see what can be done.
thx,
best
elraff,
This solution worked for me. Ensure that you’re changing the 11 in his code to your actual page number. Works for me 100%.
I use WP SUPER CACHE, too. Had to clear it to see the changes.
I think this is important to show correctly how to do. Where does this code go? Can it go into functions.php for example? For example, why doesn’t this work?:
add_filter( 'a3_lazy_load_run_filter', 'skip_a3_lazy_load_for_this_page', 11 );
function skip_a3_lazy_load_for_this_page( $apply_lazyload ) {
if ( is_cart() ) {
$apply_lazyload = false;
return $apply_lazyload;
}
}
Hi Uroboros,
If you put my code into functions.php, it will have affect to all pages, and it does not like what we want that just don’t apply to some pages.
And your code have bit wrong, it need to have value return but current it just return false if it’s cart page, below is what i edited for you and if put it into functions.php, it will have affect for cart page without use lazyload
add_filter( 'a3_lazy_load_run_filter', 'skip_a3_lazy_load_for_this_page', 11 );
function skip_a3_lazy_load_for_this_page( $apply_lazyload ) {
if ( is_cart() ) {
$apply_lazyload = false;
}
return $apply_lazyload;
}
Regards,
Nguyen