[WordPress] 外掛分享: Term Featured Image Fallback

首頁外掛目錄 › Term Featured Image Fallback
WordPress 外掛 Term Featured Image Fallback 的封面圖片
全新外掛
安裝啟用
尚無評分
3243 天前
最後更新
問題解決
WordPress 4.4+ v1.0.4.1 上架:2017-04-28

內容簡介

特點:

將特色圖像添加到任何分類法的所有詞彙中,包括類別、標籤或任何自訂分類法的詞彙。
為任何文章類型設定後備選項,以便它們將詞彙特色圖像用作文章特色圖像的後備選項。
在詞彙中設定優先級,以便每篇文章使用較高優先級的特色圖像作為後備選項,以防該文章關聯多個詞彙。
在分類法中也可以設定優先級,以防文章關聯不同分類法的一個或多個詞彙。
按文章類型啟用和停用後備選項。
清除卸載選項,以刪除與此外掛相關的所有數據,便於您保持資料庫的整潔。
如果您是開發人員,您可以使用 cs__the_term_thumbnail() 和 cs__get_term_thumbnail_id() 函數來為任何詞彙獲取特色圖像或特色圖像 ID。

教程

轉到「外觀」-「分類法圖像」

在「分類法配置」中,您有一個分類法列表。
2.1. 在第一個下拉選單中,您可以選擇它的詞彙是否應該具有特色圖像。
2.2. 在第二個下拉選單中,您可以選擇該分類法是否應該作為後備選項,當文章關聯到該詞彙時使用其作為特色圖像的後備選項。
您還可以選擇優先級,以防它們有多個分類法的詞彙。
2.3. 在「文章類型配置」區域,有一個文章類型列表。您可以選擇是否為每個文章類型啟用或禁用分類法特色圖像的後備選項。

如果您轉到啟用特色圖像的分類法的頁面,您應該能夠上傳特色圖像,並在文章有該分類法多個詞彙的情況下設置優先級。

開發人員可使用以下函數:

4.1. cs__the_term_thumbnail($termid[可選])
您可以使用此函數來列印詞彙特色圖像(如果已選擇)。
您可以傳遞termid參數以列印該詞彙的圖像。
如果您不傳遞termid參數,它將打印當前分類法圖像,以防您在詞彙歸檔頁面上,或如果當前查詢中有詞彙。
4.2. cs__get_term_thumbnail_id($termid[可選])
您可以使用此函數來取得已選擇的詞彙特色圖像ID。
您可以傳遞termid參數以獲取該詞彙的特色圖像ID。
如果不傳遞termid參數,它將在詞彙歸檔頁面上取得當前分類法圖像ID,或者如果當前查詢中存在詞彙,則取得當前分類法圖像ID。

外掛標籤

開發者團隊

⬇ 下載最新版 (v1.0.4.1) 或搜尋安裝

① 下載 ZIP → 後台「外掛 › 安裝外掛 › 上傳外掛」
② 後台搜尋「Term Featured Image Fallback」→ 直接安裝(推薦)
📦 歷史版本下載

原文外掛簡介

Features:

Add featured images to all terms of any taxonomy, including, categories, tags or terms of any custom taxonomy.
Set a fallback option for posts of any post type so they use term featured images as fallback for post featured images.
Set a priority in terms so the each post uses the higher priority featured image as fallback in case the post has many terms associated.
Set also a priority in taxonomies in case a post has one or more terms of different taxonomies associated.
Enable and disable the fallback option by post type.
Clean uninstall option to delete all data related to this plugin so you can keep your database clean.
If you are a developer, you can use the cs__the_term_thumbnail() and the cs__get_term_thumbnail_id() functions to get the featured image or the featured image id for any term.

Tutorial

Go to Appearance -> Taxonomy images

In “Taxonomy configuration” you have a list of taxonomies.
2.1. In the first select box you can select here whether its terms should have a featured image.
2.2. In the second select box you can select if posts should use this taxonomy as a fallback for the featured image in case they have a term associated.
You can also select the priority in case they have terms of more than one taxonomy.
2.3. In the “Post type configuration” area there’s a list of post types. You can select if the taxonomy featured image fallback should be enabled or disabled for each post type.

If you go to the page of a taxonomy in which the featured image is enabled, you should be able to upload a featured image and also to set the priority, in case a post has more than one term of this taxonomy.

Functions for developers:

4.1. cs__the_term_thumbnail($termid[OPTIONAL])
You can use this function to print the term featured image in case there’s one selected.
You can pass the termid parameter to print the image for a term.
If you don’t pass the termid parameter, it will print the current taxonomy image in case tou are in a term archive page or if there is a term in the current query.
4.2. cs__get_term_thumbnail_id($termid[OPTIONAL])
You can use this function to get the the term featured image id in case there’s one selected.
You can pass the termid parameter to get the featured image id of that term.
If you don’t pass the termid parameter, it will get the current taxonomy image id in case tou are in a term archive page or if there is a term in the current query.

延伸相關外掛

文章
Filter
Apply Filters
Mastodon