
內容簡介
WP Featherlight 是一個 WordPress 外掛,可為您的WordPress 網站添加一個極簡、高效、響應式 jQuery 燈箱。在其核心,WP Featherlight是一個用於 Featherlight jQuery 燈箱外掛的 WordPress 外掛包裝器。安裝後,該外掛將自動在一個簡單的極簡主義燈箱彈出中顯示所有標準 WordPress 的圖片和畫廊 。
為使 WordPress 的圖片和畫廊能夠使用燈箱,您需要在選擇縮略圖應該鏈接的位置時選擇「媒體文件」選項。如果確保直接鏈接到圖像文件,也可以選擇「自定義鏈接」選項。這應該適用於任何圖像文件,即使它托管在另一個網站上。
通過添加數據屬性到您的內容,WP Featherlight 也可以為視頻、iframe 和 ajax 內容提供燈箱。有關自定義內容加載的更多詳細信息,請參閱 Featherlight 文檔。
WP Featherlight 沒有任何設置,因此您應該可以安裝它而無需進行任何配置。如果您不希望在某些頁面或帖子上使用燈箱,則有一個選項可以從帖子編輯屏幕中禁用它。
如果您發現顯示問題,可能與您的主題有關,但請打開支援請求讓我們進行調查。有關 Featherlight 腳本本身的更多信息,請查看他們的GitHub 外掛頁面。
開發者注意事項
雖然外掛中沒有任何選項,但有一些方便的篩檢器可修改默認行為。從 0.3.0 開始,所有使用 WordPress 默認標題的圖像在燈箱模式下也會包含一個標題。要禁用此行為,向篩檢器 wp_featherlight_captions過濾成 false 。
您還可以使用篩檢器在 /includes/class-scripts.php 文件中條件地禁用 CSS 和 JavaScript 的包含。如果您對任何外掛的任何部分的工作方式有疑問,請不要猶豫,在 GitHub 上打開一個問題。
貢獻
如果您想提交代碼補丁或以任何其他方式做出貢獻,請在 GitHub 上 fork 這個外掛。
外掛標籤
開發者團隊
② 後台搜尋「WP Featherlight – A Simple jQuery Lightbox」→ 直接安裝(推薦)
原文外掛簡介
WP Featherlight is a WordPress lightbox plugin for adding a minimal, high-performance, responsive jQuery lightbox to your WordPress website. At its core, WP Featherlight is a WordPress plugin wrapper for the Featherlight jQuery lightbox plugin. When installed, the plugin will automatically display all standard WordPress images and galleries in a simple, minimalistic lightbox popup.
In order for WordPress images and galleries to be lightboxed, you need to select the “Media File” option when choosing where the thumbnails should link. You can also select the “Custom Link” option if you make sure to link directly to an image file. This should work for any image file, even if it’s hosted on another website.
It’s also possible to lightbox videos, iframes, and ajax content with WP Featherlight by adding data attributes to your content. For more details on custom content loading, check out the featherlight documentation.
There are no settings for WP Featherlight, so you should be able to install it without needing to configure anything. In the event you don’t want a lightbox on certain pages or posts, there is an option to disable it from within the post editor screen.
If you find a display problem, it may be related to your theme but please open an support request about it so we can look into it. For more information about the Featherlight script itself, check out their GitHub plugin page.
Developer Notes
While there are no options in the plugin, there are some handy filters to modify the default behavior. As of 0.3.0 all images which use the default WordPress captions will also include a caption when the image is lightboxed. To disable this behavior, filter wp_featherlight_captions to false.
You can also disable inclusion of the CSS and JavaScript conditionally using filters which can be found in the /includes/class-scripts.php file. If you have questions about how any part of the plugin works, please don’t hesitate to open an issue on GitHub.
Contributing
If you’d like to submit code patches or contribute in any other way, please fork the plugin on GitHub.
