[WordPress] 外掛分享: Category Based Archives

首頁外掛目錄 › Category Based Archives
10+
安裝啟用
尚無評分
6436 天前
最後更新
問題解決
WordPress 2.5+ v1.0.5 上架:2008-08-03

內容簡介

WordPress 內建的存檔頁面在某些方面受限,因為除了顯示內容之外,並不能夠提供太多其他設定。例如,基於日期顯示的存檔頁面只會顯示日期,類別顯示的則只會顯示分類。這個外掛解決了這個問題,讓基於日期的存檔頁面也能按類別分顯示內容。

透過修改重新導向規則,即可使用類似 http://yourblog.com/2008/in-blog/ 這樣的固定連結格式。此格式會顯示基於日期的存檔頁面,並只列出屬於「blog」類別的文章。

此外,此外掛也支援年份和月份的基於日期的存檔頁面,並且可以在不使用重新導向規則的情況下正常運作。

針對佈景主題開發人員的可用指令

這些針對佈景主題開發人員的 PHP 指令非常容易使用。

cba_get_category_id() 用以取得當前存檔頁面的分類 ID。

cba_the_year() 用以取得當前基於日期的存檔頁面的年份。

cba_the_month() 用以取得當前基於日期的存檔頁面的月份。

cba_auto_thedate() 用來取得代表日期的字串。

cba_get_year_link($year) 用以取得基於當前分類的年份存檔頁面的 Permanent Link。

外掛標籤

開發者團隊

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

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

原文外掛簡介

The archives within WordPress are pretty limited in a sense that they do not offer much configuration beyond what they do. Date based will be date based, like category based archives will only display categories. This plugin mitigates the issue by giving date based archives the ability to list content by categories as well.
This is done via modification of the rewrite rules to allow for the ability to have permalinks like http://yourblog.com/2008/in-blog/. This basically is a date based archive that shows only entries from the “blog” category.
This plugin can also work without the usage of rewrite rules. It currently supports date based archives for years and months.
Usable Commands for Theme Developers
The PHP commands for theme developers to use are pretty straight forward.
cba_get_category_id() returns the current category ID of the archive.
cba_the_year() returns the current year of the date based archive.
cba_the_month() returns the current month of the date based archive.
cba_auto_thedate() gets the string representation of the date.
cba_get_year_link($year) returns the permalink for the year archive based on the current category.

延伸相關外掛

文章
Filter
Mastodon