[WordPress] 外掛分享: Image Shortcake

前言介紹

  • 這款 WordPress 外掛「Image Shortcake」是 2015-05-19 上架。
  • 目前有 10 個安裝啟用數。
  • 上一次更新是 2015-08-27,距離現在已有 3538 天。超過一年沒更新,安裝要確認版本是否可用。以及後續維護問題!
  • 外掛最低要求 WordPress 3.0.1 以上版本才可以安裝。
  • 有 1 人給過評分。
  • 還沒有人在論壇上發問,可能目前使用數不多,還沒有什麼大問題。

外掛協作開發者

goldenapples | danielbachhuber | fusionengineering |

外掛標籤

images | shortcodes |

內容簡介

當從媒體庫或媒體上傳程式將圖片插入文章時,只有 標籤的 HTML 和包含該標籤(如果有的話)的連結被保存。這意味著希望更改內容中圖片標記方式的佈景主題沒有一種簡單的方法可以實現。

Image Shortcake 嘗試通過將圖片保存為短碼而不是 HTML 來解決這個問題。短碼的輸出可以在主題、外掛和模板中輕鬆地進行篩選,並且由於原始附件數據被保存為短碼的屬性,因此在主題中更改圖片標記方式變得更加容易。

為了獲得最佳效果,建議與 Shortcake (短碼 UI) 外掛一起使用。Shortcake 提供了一個易於使用的介面來管理文章內容中的短碼。

您可以用 Image Shortcake 實現什麼功能?在 Fusion,我們使用此短碼來實現以下功能:

響應式圖片。通過篩選 [img] 短碼圖像標籤的輸出,我們可以插入 srcset 屬性,以便所有圖像都能夠在支持此功能的瀏覽器中響應式顯示。

內嵌共享按鈕。我們將共享連結添加到網站上的每個圖片。由於這些共享連結是通過篩選器插入到短碼中而不是在文章內容中,因此很容易在運行時進行修改。且輸出短碼的邏輯在模板文件中而不是在頁面載入後運行的 on-page javascript 中,這使得使用更快捷。

圖片來源。我們添加了「credit」作為圖像元數據欄位,並在「img_shortcode_output_after_linkify」篩選器上使用它在所有圖像上顯示出來。

有關自定義圖片模板的更多想法和提示,請參見安裝一節。也歡迎您在 Github 上 參與該專案。

原文外掛簡介

When images are inserted into posts from the media library or media uploader, only the html of the tag and the link around it (if any) are preserved. This means that themes which want to change the way images are marked up in content don’t have an easy way of doing this.
Image Shortcake is an attempt to solve this problem, by saving images in post content as shortcodes rather than HTML. The output of shortcodes can be easily filtered in themes, plugins and templates, and since the original attachment data is preseved as attributes on the shortcode, it becomes much easier for modify the way images are marked up in themes.
For best results, use this with the Shortcake (Shortcode UI) plugin. Shortcake offers an easy to use interface to manage shortcodes in post content.
What could you use this for? Well, at Fusion we use this shortcode for:

Responsive Images. By filtering the output of the [img] shortcode image tag, we’re able to insert the srcset attribute, so that all of
the images on our site are served responsively to browsers that support that.

Inline sharing buttons. We’ve added share links to each of the images on our site. Because these are inserted through a filter on a shortcode and not in the post content, it’s easy to modify them on the fly. And having this logic in template files rather in on-page javascript that runs after page load makes it quicker for users.

Photo credits. We’ve added “credit” as an image meta field, and we use a filter on ‘img_shortcode_output_after_linkify’ to display it on all images.

See the Installation section for more ideas and tips for custom image templates. Get involved with the project on Github.

各版本下載點

  • 方法一:點下方版本號的連結下載 ZIP 檔案後,登入網站後台左側選單「外掛」的「安裝外掛」,然後選擇上方的「上傳外掛」,把下載回去的 ZIP 外掛打包檔案上傳上去安裝與啟用。
  • 方法二:透過「安裝外掛」的畫面右方搜尋功能,搜尋外掛名稱「Image Shortcake」來進行安裝。

(建議使用方法二,確保安裝的版本符合當前運作的 WordPress 環境。


0.1.0 | trunk |

延伸相關外掛(你可能也想知道)

  • Autoptimize 》Autoptimize 能夠輕鬆優化您的網站。它可以整合、縮小和快取腳本和樣式表,在默認情況下向頁面 head 中注入 CSS,但也可以內嵌關鍵 CSS 並延遲整合的完整 CSS...。
  • WebP Express 》ch means less bandwidth usage and faster page load times., Easy to use - with little effort, WordPress site admins can have their site serving auto...。
  • Recent Posts Widget With Thumbnails 》列出最新的文章標題、縮略圖、摘要、作者、類別、日期等等!, 雖然此外掛僅建立在小工具區域,但使用者報告說它在 Elementor 和 Oxygen 上運作順暢。但它是否...。
  • Modern Image Formats 》外掛介紹:此外掛可在 WordPress 應用程式中增加 WebP 支援,但僅針對新上傳的影像檔案轉換成 WebP 格式,現有檔案不會轉換。預設情況下,WebP 只會針對 JPEG...。
  • Responsive Lightbox & Gallery 》提供完整的 WordPress 相簿外掛所需一切, Responsive Lightbox and Gallery 外掛是一個全功能的 WordPress 相簿外掛,擁有強大的拖放相簿生成器和 Lightbox ...。
  • Lightbox & Modal Popup WordPress Plugin – FooBox 》FooBox是第一個嚴肅考慮響應式佈局的燈箱。它不僅會將圖片縮放以在手機上呈現更好的效果,還會重新排列按鈕控制,使其在縱向或橫向的方向上都展現出色的外觀...。
  • Media Cleaner: Clean your WordPress! 》Media Cleaner 是一個強大的外掛,它可以幫助你清理 WordPress 媒體庫中未使用的媒體條目和文件,以及修復損壞的條目。內置回收站功能讓你可以在永久刪除之前...。
  • Media Library Assistant 》媒體庫助手提供多個增強功能,方便管理媒體庫,其中包括:, , , , [mla_gallery] 短碼,在文章、頁面或自訂文章類型中使用,添加圖片和/或其他媒體庫項目(...。
  • Image Placeholders 》總結:, 這個外掛可以在WordPress的媒體庫中確定並儲存新上傳圖片的主要顏色,並且利用它在前端建立一個相應顏色的佔位背景,在圖片加載之前可見。, , 問題與...。
  • Image Watermark 》Image Watermark 外掛能讓您自動給 WordPress 媒體庫上傳的圖片打上浮水印,也可大量添加浮水印到之前上傳的圖片之中。, 欲進一步瞭解,請前往dFactory的外掛...。
  • FancyBox for WordPress 》本外掛能讓FancyBox輕鬆整合到您的部落格:上傳,啟用,完成。您也能選擇進行更多的設置。, 您幾乎可以對Fancybox lightbox的所有屬性進行自定義:邊框、邊緣...。
  • Crop-Thumbnails 》此外掛提供調整裁切圖像的裁切區域功能。它會在編輯頁面和媒體對話框中添加按鈕,以便進入裁剪編輯器。, 在裁剪編輯器中,您可以選擇一個或多個(如果它們具...。
  • Clean Image Filenames 》這個外掛可以在您上傳至媒體庫時自動將檔名中的語言重音符號轉換。轉換後的字符將會變成網頁和伺服器友好、無語言重音的字元。, 功能, , 將瑞典語、丹麥語、...。
  • Enhanced Responsive Images 》這個外掛程式實現了將 sizes="auto" 加入到懶加載圖片的 HTML 規格。, 相關背景資訊請參考:https://github.com/whatwg/html/issues/4654。, , 問...。
  • Optimus – WordPress Image Optimizer 》WordPress圖片優化器, Optimus可自動降低已上傳媒體檔案的檔案大小。根據圖片和格式,可以減少高達70%的大小。每張圖片可以節省數千位元組,這些節省可以對博...。

文章
Filter
Apply Filters
Mastodon