Title: lazy load support
Last modified: March 5, 2020

---

# lazy load support

 *  [Antony Booker](https://wordpress.org/support/users/antonynz/)
 * (@antonynz)
 * [6 years, 2 months ago](https://wordpress.org/support/topic/lazy-load-support-3/)
 * I have a gallery that is loading a lot of images, and have added a lazy load 
   plugin (s3 lazy load), however I needed to add the width and height of the images
   to make the gallery compatible. The lazy load support option within the plugin,
   fixes the compatibility but stopped the lazy loading functionality.
 * Would it be possible to add the height and width of the attachment images to 
   the img element to make this plugin fully lazy load compatible for future releases?
 * Here is the change I made to the MasonryGallery.php file to include the width
   and height of the attachment:
 *     ```
        $image_attributes = wp_get_attachment_image_src( $attachment_id, "full"  );
   
                   $items[] = sprintf(
                       '<div class="grid-item et_pb_gallery_image">
                           <a href="%1$s"%4$s%5$s>
                               <img width="%10$s"
                               	height="%11$s"
                               	src="%1$s"
                                    alt="%2$s"
                                    title="%3$s"
                                    srcset="%9$s 768w, %8$s 980w, %7$s 1024w"
                                    sizes="(max-width: 768px) 768px, (max-width: 980px) 980px, 1024px" />
                               %6$s
                           </a>
                       </div>',
                       $image,
                       $image_alt,
                       $image_title,
                       'on' === $args["title_in_lightbox"] ?  " data-title='$image_title'" : '',
                       'on' === $args["caption_in_lightbox"] ?  " data-caption='" . wp_get_attachment_caption($attachment_id) . "'" : '',
                       'on' === $args['use_overlay'] ? et_core_esc_previously($overlay_output) : "",
                       $image_desktop_url,
                       $image_tablet_url,
                       $image_phone_url,
                       $image_attributes[1],
                       $image_attributes[2]
                   );
       ```
   

Viewing 1 replies (of 1 total)

 *  Plugin Author [janthielemann](https://wordpress.org/support/users/janthielemann/)
 * (@janthielemann)
 * [6 years, 2 months ago](https://wordpress.org/support/topic/lazy-load-support-3/#post-12531713)
 * Hi, I can look into this and see if I can integrate it into the core without 
   affecting others.

Viewing 1 replies (of 1 total)

The topic ‘lazy load support’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/ds-suit.svg)
 * [Battle Suit for Divi](https://wordpress.org/plugins/ds-suit/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/ds-suit/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/ds-suit/)
 * [Active Topics](https://wordpress.org/support/plugin/ds-suit/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/ds-suit/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/ds-suit/reviews/)

 * 1 reply
 * 2 participants
 * Last reply from: [janthielemann](https://wordpress.org/support/users/janthielemann/)
 * Last activity: [6 years, 2 months ago](https://wordpress.org/support/topic/lazy-load-support-3/#post-12531713)
 * Status: not resolved