前言介紹
- 這款 WordPress 外掛「Taxonomy Thumbnail」是 2015-06-14 上架。
- 目前有 4000 個安裝啟用數。
- 上一次更新是 2016-05-30,距離現在已有 3260 天。超過一年沒更新,安裝要確認版本是否可用。以及後續維護問題!
- 外掛最低要求 WordPress 3.5 以上版本才可以安裝。
- 有 10 人給過評分。
- 還沒有人在論壇上發問,可能目前使用數不多,還沒有什麼大問題。
外掛協作開發者
greglone |
外掛標籤
dev | image | category | taxonomy | thumbnail |
內容簡介
is plugin is meant for developers. It allows developers to attach a thumbnail to taxonomy terms. The thumbnail can be added during term creation or later on the term edition page. The terms list has a column displaying the current thumbnail.
The plugin uses the latest media window and is designed to enhance accessibility. The UI contains more than just an "Add thumbnail" button, and the `wp.a11y.speak()` function is used when available.
The plugin works with or without JavaScript. If JavaScript is enabled, thumbnails are set via ajax in the term edition window, and there is no need to update the term. By default, the UI is displayed for all public taxonomies. You can filter it by using this code:
add_filter( 'sftth_taxonomies', 'my_taxonomies_with_thumbnail' );
function my_taxonomies_with_thumbnail( $taxonomies ) {
unset( $taxonomies['post_tag'] );
$taxonomies['my_custom_tax'] = 'my_custom_tax';
return $taxonomies;
}
There are also several template tags available in `inc/template-tags.php` to mimic post thumbnail functions. For WordPress 4.4+, these functions use `term_id`. For earlier versions, they use `term_taxonomy_id.`
From WordPress 4.4, the term metas API is used. Below WordPress 4.4, there are two ways to store the thumbnail IDs: using term metas with the plugin `Meta for Taxonomies`, or using an option. The option name can be customized by defining the constant `SFTTH_OPTION_NAME` in `wp-config.php.`
You can use `get_terms()` with a specific parameter to retrieve only terms with a thumbnail, or to retrieve all terms, but with the thumbnails cached, saving calls to the database later.
When uninstalling the plugin, you can decide whether or not to delete the thumbnail data.
原文外掛簡介
This plugin is meant for developers, it allows to attach a thumbnail to taxonomy terms.
UI for setting the thumbnails
The thumbnail can be added on term creation or later on the term edition page.
The terms list has a column displaying the current thumbnail (so far, no specific action here).
The plugin uses the “new” media window (the one used since WP 3.5), not the old thickbox.
I made some extra efforts to enhance accessibility. I’m not an a11y expert but the UI is not only a “Add thumbnail” button. For instance, the new wp.a11y.speak() is used when available. Please give me feedback if you think it can be improved.
Works with or without JavaScript.
If JavaScript is enabled, thumbnails are set via ajax in the term edition window, no need to update the term.
By default, the UI is displayed for all public taxonomies, but this can be filtered that way:
add_filter( 'sftth_taxonomies', 'my_taxonomies_with_thumbnail' );
function my_taxonomies_with_thumbnail( $taxonomies ) {
unset( $taxonomies['post_tag'] );
$taxonomies['my_custom_tax'] = 'my_custom_tax';
return $taxonomies;
}
Template tags
Find them in inc/template-tags.php.
Important note: for WP 4.4+, these functions use term_id. For WP thumbnail_id integers). The option name can be customized by defining the constant SFTTH_OPTION_NAME in wp-config.php.
Get terms
Use get_terms() with a specific parameter to retrieve only terms with a thumbnail:
$terms = get_terms( array(
'with_thumbnail' => true,
) );
From WordPress 4.4, you can also use a small helper to build your meta query:
$terms = get_terms( array(
'meta_query' => array(
'relation' => 'AND',
array(
// Any meta query.
),
sftth_meta_query(),
),
) );
Below WordPress 4.4, if you use the plugin Meta for Taxonomies, you should always cache thumbnails.
When using 'with_thumbnail' => false you will retrieve all terms, even those without a thumbnail, but the thumbnails will be cached, saving calls to the database later:
$terms = get_terms( array(
'with_thumbnail' => false,
) );
Uninstall
When uninstalling the plugin, you can decide to not delete the thumbnails, simply define a constant in wp-config.php:
define( 'SFTTH_KEEP_DATA', true );
Translations
US English
French
Requirements
Should work starting from WP 3.5, but tested only in WP 4.2.2+ so far.
Credits
Photo used for the banner by Nicolas Janik (CC BY 2.0).
各版本下載點
- 方法一:點下方版本號的連結下載 ZIP 檔案後,登入網站後台左側選單「外掛」的「安裝外掛」,然後選擇上方的「上傳外掛」,把下載回去的 ZIP 外掛打包檔案上傳上去安裝與啟用。
- 方法二:透過「安裝外掛」的畫面右方搜尋功能,搜尋外掛名稱「Taxonomy Thumbnail」來進行安裝。
(建議使用方法二,確保安裝的版本符合當前運作的 WordPress 環境。
1.1 |
延伸相關外掛(你可能也想知道)
Regenerate Thumbnails 》重新生成縮略圖插件可以讓您為已上傳到媒體庫的一個或多個圖像重新生成所有縮略圖大小。, 這對以下情況很有用:, , 您新增了新的縮略圖大小,並且您希望過去...。
Force Regenerate Thumbnails 》『Force Regenerate Thumbnails』可以讓您刪除所有舊圖像大小,並確實重新生成上傳圖像的縮略圖。, 在「工具」管理員選單中從頭開始生成所有縮略圖,或透過媒...。
Perfect Images 》使用 Perfect Images,輕鬆掌握您的圖像!這個強大的外掛可助您進行圖像優化和管理,輕鬆替換或批量重新生成現有圖像,設置自定義尺寸,提高性能,並為高質量...。
AJAX Thumbnail Rebuild 》AJAX Thumbnail Rebuild 可讓您重新建立網站上的所有縮圖。儘管已經有一些插件可供使用,但它們有一個共同點:所有縮圖都會在單一步驟中重新建立。如果您的網...。
XO Featured Image Tools 》此外掛可以自動從文章中的圖片產生特色圖片。, 功能, , 一次性產生所有文章的特色圖片。, 在儲存文章時自動產生特色圖片。, 批次刪除文章的特色圖片。, 於文...。
Conditionally display featured image on singular posts and pages 》注意事項, 如果你的佈景主題使用自訂調用來載入特色圖片(如 Twenty Seventeen 主題),則本外掛可能無法運作!請使用 get_the_post_thumbnail()、wp_get_att...。
Featured Image Admin Thumb 》啟用此外掛後,它會在「所有文章/所有頁面」及支援的所有自訂文章類型管理介面中新增一欄,名為「Thumb」。這一欄會顯示文章特色圖片或者是文章縮圖的縮略圖...。
Videopack 》一個外掛,用於製作視頻播放器、縮略圖、多個分辨率和視頻庫。, 這個視頻外掛可以將各種選項添加到上傳到 WordPress 媒體庫的任何視頻。如果您的瀏覽器原生支...。
PDF Image Generator 》這個外掛可以透過上傳 PDF 附件,將封面轉換為 JPEG,並作為文章縮略圖檔案附加。它還允許顯示縮略圖標誌和插入 PDF 鏈接與封面圖像到編輯器。, , 僅支援 Wor...。
Manual Image Crop 》此外掛允許您手動裁剪 WordPress 佈景主題中註冊的所有圖片尺寸(特別是特色圖片)。, 只需點擊您媒體庫中任何圖片旁邊的“裁剪”連結。, 將顯示...。
Kama Thumbnail 》這個外掛可以方便地在不增加負擔的情況下即時建立文章縮圖,是 "thumbnail.php" 腳本的最佳替代品。, 支援多站點。, 使用方法, 這是針對開發人員的外掛,安裝...。
Get the Image 》「Get the Image」是 WordPress 中最先進的縮略圖 / 圖片外掛之一。, 從小型博客到大型企業級解決方案 (如WordPress.com VIP),此插件適合所有人使用。它之所...。
Easy Add Thumbnail 》註: 此外掛功能由超過 10,000 個活躍的安裝保證。但在安裝此外掛之前請注意,它的唯一目的是將功能影像識別碼 (使用 WP 編輯器相同的方式) 添加到您的文章中...。
Document Gallery 》這個外掛可讓使用者毫不費力地建立文件和其他附加媒體的圖庫,就像現有的圖像附件圖庫選項一樣。, 觀看以下視頻以瞭解 Document Gallery 如何運作:, , 在設...。
Advanced Random Posts Widget 》注意事項, 此外掛已不再支援,請使用 Recent posts widget Extended 取代。, 此外掛提供更彈性和進階的隨機文章列表功能。您可以透過縮略圖、摘要和文章日期...。