前言介紹
- 這款 WordPress 外掛「Hide featured image on all single page/post」是 2020-12-31 上架。
- 目前有 7000 個安裝啟用數。
- 上一次更新是 2022-02-04,距離現在已有 1184 天。超過一年沒更新,安裝要確認版本是否可用。以及後續維護問題!
- 外掛最低要求 WordPress 4.6 以上版本才可以安裝。
- 外掛要求網站主機運作至少需要 PHP 版本 7.2 以上。
- 有 14 人給過評分。
- 還沒有人在論壇上發問,可能目前使用數不多,還沒有什麼大問題。
外掛協作開發者
外掛標籤
內容簡介
這個輕巧的外掛在瀏覽單獨的頁面和文章時隱藏所有的特色圖片。文章不會被修改—如果你已選擇了特色圖片,它仍然存在。這個外掛只是禁用佈景主題渲染頁面時訪問圖片的能力。如果你的佈景主題在搜尋結果、文章頁、分類列表等顯示特色圖片,它仍然可以這樣做。搜尋引擎和社交媒體平台尋找一個伴隨摘要的圖片時,也仍然可以在文章元數據中找到特色圖片的URL。
此外掛沒有設置,只會執行一項功能。
更改會套用於現有的文章,以及在活動後創建的所有文章。你需要編輯任何受此更改影響的舊文章(如果你想顯示特色圖片,你需要將其插入到內容中)。如果你有很多舊內容,你可能需要使用其他外掛,例如在單頁和文章上條件顯示特色圖像,它僅影響新文章。
技術註解
佈景主題通過直接在數據庫中查找數據而不是調用get_the_post_thumbnail()或wp_get_attachment_image()找到特色圖片的,仍然可能在此外掛情況下發出特色圖片的HTML。作為第二道防線,此外掛加載了一個樣式表,如果在HTML中發現圖片,會試圖隱藏它。如果佈景主題使用了不尋常的實體和類名,這也可能失敗。自定義CSS規則應當始終可以作為備用方案(在這種情況下,就不需要使用此外掛了)。
這個外掛還無意中阻止了特色圖片在你插入的「文章特色圖片」區塊中出現。我正在研究是否可能檢測到預設顯示和後來有意插入特色圖片之間的區別。與此同時,作為解決方法,不要使用「文章特色圖片」區塊,而要插入一個「圖片」區塊,從媒體庫中重新選擇圖像(我更喜歡這種方式,因為它可以更好地控制大小、alt文本等)。
如果你發現某個佈景主題對此外掛不起作用,請告訴我。
捐贈
作者並不是在為自己募款。如果您覺得此外掛有用並想要回報,請考慮捐贈給直接幫助有需要的人的組織。
原文外掛簡介
This lightweight plugin hides all featured images on pages and posts when they are viewed in their own tab. The posts are not modified — they still have a featured image if you selected one. The plugin only disables the theme’s ability to access the image when rendering the page. If your theme displays featured images in search results, Posts page, category lists, and so on, it still can do that. Social media platforms and search engines that look for an image to accompany the excerpt, can also still find the featured image URL in the post metadata.
There are no settings; the plugin just does the one thing.
The change applies to existing posts as well as anything you create after activation. You would need to edit any old posts that are adversely affected by this change (if you want the featured image to display, you would have to insert it into the content). If you have a lot of old content, you might want to use a different plugin such as Conditionally display featured image on singular pages and posts, which by default only affects new posts.
TECHNICAL NOTE
Themes that find the featured image by looking up data in the database directly as opposed to calling get_the_post_thumbnail() or wp_get_attachment_image(), may still emit HTML for the featured image despite this plugin. As a second line of defense, the plugin loads a stylesheet that tries to hide the image if it is present in the HTML. This also might fail if the theme has used unusual entities and class names. Custom CSS rules should always be possible as a fallback (in which case you don’t need this plugin).
This plugin also (not on purpose) blocks the featured image from appearing in the content where you’ve inserted a “Post featured image” block. I’m looking into whether it might be possible to detect the difference between a request for the featured image for default display versus a deliberate insertion later. In the meantime, as a workaround, don’t use the “Post featured image” block, but instead insert an “Image” block and re-select the image from your media library (I prefer that anyway since it gives more control over size, alt text, etc).
If you find a theme this doesn’t work with, please let me know.
Donations
The author is not soliciting donations for himself. If you find this useful and want to pay it forward, please consider donating to an organization that directly helps people in need.
各版本下載點
- 方法一:點下方版本號的連結下載 ZIP 檔案後,登入網站後台左側選單「外掛」的「安裝外掛」,然後選擇上方的「上傳外掛」,把下載回去的 ZIP 外掛打包檔案上傳上去安裝與啟用。
- 方法二:透過「安裝外掛」的畫面右方搜尋功能,搜尋外掛名稱「Hide featured image on all single page/post」來進行安裝。
(建議使用方法二,確保安裝的版本符合當前運作的 WordPress 環境。
延伸相關外掛(你可能也想知道)
Quick Featured Images 》快速管理 WordPress 的精選圖片外掛程式 - Quick Featured Images,是個節省時間的管理海量精選圖片的工具。使用它可以快速地批量處理、設定、替換和刪除精選...。
Acme Fix Images – Regenerate Thumbnails 》當您在媒體設定中變更圖像大小後,它允許您將所有圖像固定為該大小。, , 登入管理後台,前往「外觀」=>「Acme Fix Images」。, 勾選您想要固定的圖像大小...。
Preload Featured Images 》此外掛可自動預載文章中的精選圖片以大幅提升頁面速度分數。, 對於使用主題自動在單篇文章頁面頂端顯示精選圖片的網站來說,此外掛是「必備品」。, 為何需要...。
Auto Featured Image from Title 》這個外掛能讓發布內容的過程更加簡單。, , 寫下您的博客文章。, 花數小時在線搜索庫存攝影網站,以尋找與您的博客文章完美配合的圖像。, 完成!, , 如果您沒...。
Easy Featured Images 》Easy Featured Images 使您更有效地將特色圖片分配給文章,特別是當您需要處理大量文章時。通常,您必須訪問每篇文章的編輯頁面,開啟媒體視窗並上傳/分配圖...。
Display Featured Image for Genesis 》本外掛以巧妙的方式呈現貼文和頁面的精選圖片,不僅重複使用文章內容中的圖片,更能智慧地使用適當的大圖片。根據你上傳的圖片,該外掛會執行以下操作:, , -...。
Set All First Images As Featured 》這個外掛非常簡單,它可以搜尋已發佈的文章、頁面或自訂文章類型中的所有首圖並設置為特色圖片。, , 您可以選擇要在哪個文章類型上執行此外掛。, 覆寫已選取...。
RSS with Images 》一個簡單易用的插件,可以在您的網站RSS中加入特色圖像並提供可自訂大小選項。, 將特色圖像添加到Mailchimp郵件、Infusionsoft、Hubspot、Constant Contact、...。
WP Autoset Featured Image Plus 》如果文章沒有設置特色圖片,WP Autoset Featured Image Plus 將檢查文字是否包含圖片。如果有,就將其設為特色圖片;如果沒有,您可以設置任何外部 URL 圖片...。
Theme Blvd Featured Image Link Override 》當使用具有 Theme Blvd 框架版本 2.1+ 的主題時,此外掛讓你全域地設定特色圖像的連結選項。, 問題, Theme Blvd 框架有一個複雜的內部系統,用於顯示文章及其...。
Easy Featured Images 》這個小型的外掛可以在「所有文章」頁面上新增特色圖片。。
Jump Start Banners 》在 v2.0 版本的 Jump Start 佈景主題中,有一個添加橫幅樣式到頁面和文章的功能。然而,在 v2.1 版本中,為了實現類似的效果,該功能被移除,改為使用 WordPr...。
Genesis Featured Image 》這個外掛提供了一個簡單選擇和保存的選項,讓你可以在標題前或標題後添加一個特色圖片。, 注意:儘管此外掛需要使用由 StudioPress 開發的 Genesis Framework...。
Random Post with ajax 》, 我們所創造的是優雅與簡潔的結合。, 只需要安裝並啟用 "Random post with ajax" 這個外掛,然後在網站的任何部分使用簡碼以顯示隨機文章,即可讓隨機文章出...。
Go News In Pictures 》這款小工具以磁磚式的方式展示最新文章的特色圖片,具有響應式設計。您可以選擇要顯示圖片的類別名稱。嘗試一下,非常酷炫。, 示範:http://onion.goresponsi...。