This plugin will delay the loading of background images in your website and thus helps boosting the website loading time by reducing total number of HTTP requests.
<p style=" background-image: url( path/to/background-img.jpg )" > </p>
are lazyloaded by this plugin by default . lazyload-bg
class to the element .lazyload_inline_bg_excludes
add_filter(‘lazyload_inline_bg_excludes’,function($exclude_keywords){
$exclude_keywords = [
‘bg-image.jpg’,
‘class-name’,
‘id’,
‘or any unique keyword that the element with background image has’
];
},10,1);
Note: Add the above code to the functions.php
file of your active theme/child theme or using a code snippets plugin.