[WordPress] 外掛分享: Adjacent Archive Links

首頁外掛目錄 › Adjacent Archive Links
10+
安裝啟用
★★★★★
5/5 分(2 則評價)
3959 天前
最後更新
問題解決
WordPress 3.0+ v3.0 上架:2012-11-25

內容簡介

啟用外掛後,您將擁有兩個新的範本標籤:

<?php previous_archive_link( 'format', 'link' ); ?>
<?php next_archive_link( 'format', 'link' ); ?>

它們會根據日期存檔是否是一天、一個月或一年來調整輸出,
並且它們將僅針對您已發佈文章的相鄰時間段輸出連結。這兩個標籤都需要兩個字符串參數:format和link。

format參數定義了連結前後的內容,其中%link
將被下面的link參數替換。 previous_archive_link
預設為 "“&laquo; %link”",而next_archive_link預設為 "“%link &raquo;“。

link參數定義了連結文本,這兩個標籤都默認為 "“%date“,
相鄰存檔頁面的本地化日期。

如果您有興趣貢獻此外掛程式的程式碼,該項目也可以在GitHub上找到:
https://github.com/justincwatt/wp-adjacent-archive-links

外掛標籤

開發者團隊

⬇ 下載最新版 (v3.0) 或搜尋安裝

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

原文外掛簡介

After activating the plugin, you will have two new template tags at your disposal:

They adapt their output depending on whether the date archive is a day, a month,
or a year, and they will only output a link for an adjacent time period in which you
have published posts. Both tags take two string parameters, format and link.
The format parameter defines what comes before and after the link. In it, %link
will be replaced with whatever is declared in the link parameter below. previous_archive_link
defaults to “« %link” and next_archive_link defaults to “%link »“.
The link parameter defines the link text. Both tags default to “%date“, the
adjacent archive page’s localized date.
If you’re interested in contributing to the code behind this plugin, it’s also hosted on GitHub:
https://github.com/justincwatt/wp-adjacent-archive-links

延伸相關外掛

文章
Filter
Mastodon