This is the HTML before JavaScript from the plugin does any modification:
<div class="sola_t_image " style="width:120px; height:120px;"><img src="data:image/svg+xml,%3Csvg%20xmlns='https://www.w3.org/2000/svg'%20viewBox='0%200%201%201'%3E%3C/svg%3E" data-lazy-src="https://www.horizonhomes-samui.com/wp-content/uploads/2015/04/t-ianfayhamilton.jpg" title="Ian & Fay Hamilton" alt="Ian & Fay Hamilton" /><noscript><img src="https://www.horizonhomes-samui.com/wp-content/uploads/2015/04/t-ianfayhamilton.jpg" title="Ian & Fay Hamilton" alt="Ian & Fay Hamilton" /></noscript></div>
And this is after:
<div class="sola_t_image imgLiquid_bgSize imgLiquid_ready" style="width: 120px; height: 120px; background-image: url("data:image/svg+xml,%253Csvg%2520xmlns='https://www.w3.org/2000/svg'%2520viewBox='0%25200%25201%25201'%253E%253C/svg%253E"); background-size: cover; background-position: center top; background-repeat: no-repeat;"><img src="https://www.horizonhomes-samui.com/wp-content/uploads/2015/04/t-ianfayhamilton.jpg" data-lazy-src="https://www.horizonhomes-samui.com/wp-content/uploads/2015/04/t-ianfayhamilton.jpg" title="Ian & Fay Hamilton" alt="Ian & Fay Hamilton" style="display: none;" class="lazyloaded" data-was-processed="true"><noscript><img src="https://www.horizonhomes-samui.com/wp-content/uploads/2015/04/t-ianfayhamilton.jpg" title="Ian & Fay Hamilton" alt="Ian & Fay Hamilton" /></noscript></div>
As you can see, all the inline CSS contained in the style
attribute is added dynamically by the JS from the plugin. And the background-image
is based on the src
attribute of the image container in the div
.
To disable lazyload on this page, you can use the following code:
add_action( 'wp', 'deactivate_rocket_lazyload_on_single' );
function deactivate_rocket_lazyload_on_single() {
if ( is_single( page_id ) ) {
add_filter( 'do_rocket_lazyload', '__return_false' );
}
}
by replacing page_id
by the slug or ID of the page.