Help Request: Media & Text Block Skip Lazy Loading
-
WordPress Media & Text Block uses a structure such as follows:
Parent Container: div.wp-block-media-text
Child One: figure.wp-block-media-text__media
Child Two: img needing to skip lazy loading
Adding the class of ‘skip-lazy’ (or any custom defined class) is applied to the parent DIV. The Media & Text Block does not allow for a way of adding a custom class to just the Media or just the Text.I’ve tried brute injecting the class using this jQuery code, but to no success:
jQuery('div:has(.wp-block-media-text) figure:has(.wp-block-media-text__media) img').addClass('noLazyLoad');
Before I go down to much of a rabbit hole, is there an official and simple way of excluding Media & Text Block Images from Lazy Loading. I wish to implement this for Above The Fold Media & Text instances.
Thank you in advance.
- The topic ‘Help Request: Media & Text Block Skip Lazy Loading’ is closed to new replies.