內容簡介
這個外掛與 Regenerate Thumbnails 差不多,不過圖片會在使用時自動調整大小。一旦圖片生成後,便不會再處理。
只要以下條件改變,縮略圖就會自動改變大小:
在「媒體設定」中修改圖像大小
切換有不同縮略圖/特色圖像大小的佈景主題和外掛程式
不用設定頁面,只需安裝外掛並啟用,就可以馬上使用。
從 GitHub 存儲庫中回報錯誤並協助改善代碼。
你在說什麼?
試試看。在正常的 WordPress 網站設置中,在編輯文章或頁面時,使用「添加媒體」按鈕創建一個圖庫,使用縮略圖。然後檢查圖庫。
注意縮略圖的大小,很可能是 150 x 150。看到了嗎?太好了。
現在移動到「媒體設定」,將縮略圖大小修改成更酷的、長方形的尺寸,例如 400 x 200。保存。
返回之前創建的圖庫,刷新瀏覽器。你很可能看不到 400 x 200 的縮略圖。
OTF Regenerate Thumbnails 可以為您解決此問題。
用法
OTF Regenerate Thumbnails 應該立即運行,當尺寸改變時,圖像應該會被自動調整大小。
對於開發人員和愛動手的人,確保圖像得到適當調整大小需要使用 WordPress 的圖像函數顯示特色圖像和圖像附件。別擔心,這是件好事。
確保每次顯示圖片時都使用 WordPress 函數:
wp_get_attachment_image_src
wp_get_attachment_image
the_post_thumbnail
get_the_post_thumbnail
你也可以使用 add_image_size 添加尺寸名稱。
功能
創建調整縮略圖的大小
處理「媒體設定」中的圖像大小更改
處理因切換佈景主題和外掛程式而引入的縮略圖/圖像大小更改
自動運行,無需設置
所有 the_post_thumbnail 和其他縮略圖函數的調用都會被自動處理
處理從 add_image_size 創建的圖像大小
處理 2 個項目的陣列大小
外掛標籤
開發者團隊
原文外掛簡介
This plugin behaves similarly to Regenerate Thumbnails except that images are resized automatically / on the fly, when they are used. Once created, they won’t be processed again.
Your thumbnails will now resize when:
Image Sizes in Settings > Media is modified,
Switching themes & plugins with different thumbnail / featured image sizes
No settings pages, just install and activate and things should work right away.
Report bugs and help out in the code from the Github repository
What are you talking about?
Test it out. In your normal WordPress website set up, create a gallery using the Add Media button while editing a post or page and use thumbnails. Afterwards, check out your gallery.
Notice the size of your thumbnails, most likely they’re 150 x 150. Do you see it? Great.
Now head over to Settings > Media and change your thumbnail size to something cooler, something rectangular, let’s try 400 x 200. Save it.
Go back to your gallery that you previously created and refresh your browser. Most likely you won’t be seeing 400 x 200 thumbnails there.
OTF Regenerate Thumbnails fixes this for you.
Usage
OTF Regenerate Thumbnails should work right away, and your images should get resized when the dimensions get changed.
For developers & tinkerers, ensuring your images get resized properly requires you to use WordPress’ image functions to display featured images and image attachments. Don’t worry, this is a good thing.
Make sure you use these WordPress functions every time you display images:
wp_get_attachment_image_src
wp_get_attachment_image
the_post_thumbnail
get_the_post_thumbnail
You can also add size names using add_image_size
Features
Creates Resizes thumbnails on the fly
Handles Image Size settings changes in Settings > Media
Handles thumbnail / image size changes introduced by switching themes & plugins
Works automatically, no setup needed
All calls to the_post_thumbnail and other thumbnail functions are handled automatically
Handles image sizes created from add_image_size,
Handles 2-item array sizes
