So initially I thought the last solution in this forum might have fixed the problem:
https://kriesi.at/support/topic/lazy-load-not-working-on-blog-gallery-or-portfolio-item-images/
but I’m working on a masonry gallery at the address linked in private content and there’s no hint of lazy loading going on in the network panel in the chrome console.
The last solution offered was to default images to lazy-load via this code added to functions.php:
function handler_wp_img_tag_add_loading_attr_mod( $attr_value, $image_tag = '', $context = '' )
{
return 'lazy';
}
add_filter( 'wp_img_tag_add_loading_attr', 'handler_wp_img_tag_add_loading_attr_mod', 9999, 3 );
Hey bucksharp,
Thank you for the inquiry.
Images in the masonry element are actually applied as background, not an actual image element, so lazy loading will not work for those images. This is true when the Styling > Size Settings of the masonry element is set to Perfect Automatic Masonry or Perfect Grid.
Best regards,
Ismael