I would like to know if this works for the Elementor gallery widget? Example of the page: https://placowkowo.pl/przedszkole/przedszkole-sportowe-hop-siup-bobaska/
I need to add CSS Class to all images inside the element gallery to be able to use LazyLoad on my page. All the images need to have the CSS Class inside the <img> tag or else I won’t be able to exclude it from lazyload.
]]>Hi. As i mentioned on the topic title, an exluded class is still included in the lazy load. Using wp-rocket and elementor.
]]>I reviewed the code of the plugin and it looks like it required that the Elementor image already have a class attribute. by default, they do not, so there needs to be a conditional to either add the class if a class attribute is there, or add a class attribute entirely if none exists on the image already. Code:
if ( strpos($html, “class=”) !== false ) {
return preg_replace( ‘/class=”(.*)”/’, ‘class=”‘ . $settings[‘cei_image_custom_class’] . ‘ \1″‘, $html );
} else {
return str_replace( ‘ src=”‘, ‘ class=”‘ . $settings[‘cei_image_custom_class’] . ‘” src=”‘, $html );
}
Does this add support to other widgets that contain images or just the standard images widget ?
]]>Just nothing happens.
Using WP 3.8.3 and Elementor 3.4.8
class it’s not printed in dom
]]>Is it possible to use this plugin to add class to image inside posts widget?
]]>server Error 500 with last elementor updates
]]>