[WordPress] 外掛分享: Custom-Single

首頁外掛目錄 › Custom-Single
WordPress 外掛 Custom-Single 的封面圖片
10+
安裝啟用
尚無評分
4523 天前
最後更新
問題解決
WordPress 3.5+ v1.0.0 上架:2013-12-10

內容簡介

此外掛讓佈景主題能夠根據文章分類指定不同的single.php範本。由於文章可以有多個分類,因此它使用以下方式選擇可能的自訂範本:

1)直接分配分類
— 檢查已存在的single-CATEGORYID.php檔案,並根據分類順序進行優先排序
2)分類的父級
— 根據已直接分配分類的分類順序進行父級檢查。

請注意,上述假設已安裝分類排序外掛。如果分類沒有特定的順序且每個文章有多個分類分配,則範本選擇將取決於伺服器。自然而然地,如果每篇文章僅分配一個分類(或每個文章只有一個可能的範本),則不會有問題。

需求

外掛標籤

開發者團隊

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

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

原文外掛簡介

This plugin enables themes to specify a different single.php template based on post category. As posts can have multiple categories assigned, it uses the following to select which possible custom template to use:
1) Categories directly assigned
— Check for extant single-CATEGORYID.php files and prioritize based on category order
2) Parents of categories
— Parents are checked based on category order of the directly assigned categories.
Note, the above assumes that there’s a category order plugin installed. If the categories are NOT in a specific order AND there are multiple categories assigned per post then the template selection will be left up to the server. Naturally, if there is only category assigned per post (or only one possible template per post), then there will be no issue.
Requirements

延伸相關外掛

文章
Filter
Apply Filters
Mastodon