Uname: Linux webm021.cluster127.gra.hosting.ovh.net 5.15.206-ovh-vps-grsec-zfs-classid #1 SMP Fri May 15 02:41:25 UTC 2026 x86_64
Software: Apache
PHP version: 5.4.45 [ PHP INFO ] PHP os: Linux
Server Ip: 54.36.91.62
Your Ip: 216.73.216.52
User: matthif (139342) | Group: users (100)
Safe Mode: OFF
Disable Function:
_dyuweyrj4,_dyuweyrj4r,dl

name : class-divi.php
<?php
/**
 * Divi Plugin.
 *
 * @package visual-portfolio
 */

if ( ! defined( 'ABSPATH' ) ) {
	exit;
}

/**
 * Class Visual_Portfolio_Divi
 */
class Visual_Portfolio_Divi {
	/**
	 * Visual_Portfolio_Divi constructor.
	 */
	public function __construct() {
		add_action( 'wp_head', array( $this, 'maybe_fix_images_width' ) );
	}

	/**
	 * Add CSS to fix lazy loaded Divi images widths.
	 * When the image has lazy loading attributes, width is set to 4px, not the actual image size.
	 */
	public function maybe_fix_images_width() {
		if ( ! defined( 'ET_CORE' ) || 'full' !== Visual_Portfolio_Settings::get_option( 'lazy_loading', 'vp_images' ) ) {
			return;
		}

		?>
		<style type="text/css">
			.et-db #et-boc .et-l .et_pb_module .et_pb_image_wrap,
			.et-db #et-boc .et-l .et_pb_module .et_pb_image_wrap img[data-src] {
				width: 100%;
			}
		</style>
		<?php
	}
}

new Visual_Portfolio_Divi();
© 2026 XylotrechusZ