
內容簡介
這個外掛可以延遲網站背景圖片的載入時間,因此減少 HTTP 請求的總數,從而提高網站的加載速度。
快速提示和連結
不要對在畫面上方的背景圖像進行懶加載,因為這會增加「首個內容可見時間(FCP)」的測量值,並影響網站的速度。
使用內聯 CSS 添加的背景圖像(例如 <p style = "background-image:url(path/to/background-img.jpg)"> </p>)將默認由此外掛進行懶加載。
此外掛運作時不需要依賴其他程式庫。
不會有額外的 HTTP 請求。
在外掛設置頁面中添加具有背景圖像的元素的選擇器,或將 lazyload-bg 類添加到該元素中。
Proloy Bhaduri 的 WordPress 技巧和技巧
請我喝咖啡
與幾乎所有頁面編輯器平滑運作
外掛標籤
開發者團隊
原文外掛簡介
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.
Quick Notes & Links
Do not lazyload background images which are peresent above the fold because this will increase time to First Contentful Paint(FCP) metric and affect the speed of your website .
Background images that are added using inline CSS e.g,
are lazyloaded by this plugin by default .
No dependencies required for this plugin to work.
No extra HTTP request
Add the selectors of the elements that have background images in the plugin settings page or add lazyload-bg class to the element .
WordPress Tips and Tricks By Proloy Bhaduri
Buy me a Coffee
Works smoothly with almost every page builders
Exclude certain inline background images from lazy loading using filter hook 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.
