內容簡介
由於搜尋引擎要求關於圖像的詢問,管理正確的尺寸並針對主題上各種不同尺寸的圖像進行良好的裁剪是有困難的。
考慮到這一點,我們創建了一個選項,只需替換圖像的一個尺寸,然後當圖像出現在移動設備上時,它會顯示您上傳的裁剪而不是 WordPress 創建的裁剪。
效能(開發人員)
我們主要在後端添加了篩選器和操作。有關更新的任何信息都會在此處提供。
前端篩選器
* wp_calculate_image_srcset
* wp_calculate_image_sizes
為了關閉篩選器,只需添加一個篩選器('CRI_change_sizes_attr'和'CRI_change_srcset_attr'),並返回 false。
推薦的外掛
PNG to JPG by KubiQ - 首先使用此外掛將所有PNG轉換為JPGs
Regenerate Thumbnails by Alex Mills - 如果您更改圖像尺寸或添加新的尺寸,請使用此外掛重新生成所有圖像。
外掛標籤
開發者團隊
原文外掛簡介
With the request that search engines ask around images, is difficulty to manager the right sizes and have a good crop for each image size that we have on our theme.
With that in mind, we create an option to replace just one size of the image, then when the image shows up on mobile or tablet, it will show de crop that you uploaded instead the one that WordPress made.
Performance (Devs)
We add filters and actions mainly on backend. Any updates on that will be here.
Filters on Front end
* wp_calculate_image_srcset
* wp_calculate_image_sizes
To turn off the filter, just add a filter (‘CRI_change_sizes_attr’ and ‘CRI_change_srcset_attr’) returning false.
Recommended Plugins
PNG to JPG by KubiQ – Use this first to convert all the PNG’s to JPG’s
Regenerate Thumbnails by Alex Mills – IF you change the images sizes or add new ones, use this to regenerate all the images.
