
內容簡介
此外掛讓佈景主題能夠根據文章分類指定不同的single.php範本。由於文章可以有多個分類,因此它使用以下方式選擇可能的自訂範本:
1)直接分配分類
— 檢查已存在的single-CATEGORYID.php檔案,並根據分類順序進行優先排序
2)分類的父級
— 根據已直接分配分類的分類順序進行父級檢查。
請注意,上述假設已安裝分類排序外掛。如果分類沒有特定的順序且每個文章有多個分類分配,則範本選擇將取決於伺服器。自然而然地,如果每篇文章僅分配一個分類(或每個文章只有一個可能的範本),則不會有問題。
需求
外掛標籤
開發者團隊
原文外掛簡介
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
