[WordPress] 外掛分享: Custom Taxonomy Templates

首頁外掛目錄 › Custom Taxonomy Templates
100+
安裝啟用
★★★★★
5/5 分(1 則評價)
3389 天前
最後更新
問題解決
WordPress 4.4+ v0.2.1 上架:2016-02-29

內容簡介

此外掛讓您能夠像建立自訂頁面模板一樣,藉由在檔案頂部添加以下內容,建立自訂分類法存檔樣板:

<?php
/**
* {Taxonomy Singular Label} Template: Grid
*/
?>

其中 {Taxonomy Singular Label} 應該被替換成分類法所註冊的單數標籤 (例如「分類」或「標籤」)。現在當您正在新增或編輯該分類法的分類時,您可以選擇所需的樣板檔案。

您可以將此外掛安全地包含在您的佈景主題中,並隨主題提供自訂分類法存檔樣板。

更新日誌
0.2.1

允許在樣板檔案標頭中使用分類法縮略名,修正多語言網站無法找到樣板的問題。感謝Mkdgs。

0.2

修正在使用子佈景主題時的嚴重錯誤
新增了「custom_taxonomy_templates」過濾器以增加軟體彈性

外掛標籤

開發者團隊

⬇ 下載最新版 (v0.2.1) 或搜尋安裝

① 下載 ZIP → 後台「外掛 › 安裝外掛 › 上傳外掛」
② 後台搜尋「Custom Taxonomy Templates」→ 直接安裝(推薦)

原文外掛簡介

Just like the way you can create custom page templates, this plugin enables you to build custom taaxonomy archive templates by adding this bit to the top of your file:

where {Taxonomy Singular Label} should be replaced with the singular label registered for the taxonomy (for example “Category” or “Tag”). Now when you’re adding or editing terms in that taxonomy, you can choose the desired template file.
You can safely include this plugin in your theme and ship custom templates for taxonomy archives with the theme.
Changelogs
0.2.1

Allow using taxonomy slug in the template header, fix issue with templates not being found in multilingual websites. Much thanks to Mkdgs for the fix!

0.2

Fix fatal error when using child themes
added “custom_taxonomy_templates” filter for extendibility

延伸相關外掛

文章
Filter
Apply Filters
Mastodon