It doesn’t work Part 2
-
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 );
}
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘It doesn’t work Part 2’ is closed to new replies.