跳到内容

Adjacent Archive Links

v3.0

Justin Watt · 2012年11月26日 上架

Adds two new template tags to output previous and next links on date archive pages.

正在使用
10+
评分
5.0 / 5
累计下载
3,467
最近更新
2015年5月18日
2 条评价需要 WordPress 3.0+已测试到 4.2.39

贡献者

截图

This is an example of how it looks on a date archive page customized to only show post titles in chronological order.
This is an example of how it looks on a date archive page customized to only show post titles in chronological order.

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

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

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 “&laquo; %link” and next_archive_link defaults to “%link &raquo;“.

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

Plums

按场景查找 WordPress 插件。安装量、评分和兼容版本来自官方目录。

导航

说明

WordPress 是 WordPress Foundation 的商标。本站与 WordPress Foundation、Automattic 没有隶属关系。这里不托管插件文件,下载和安装以 WordPress.org 上的页面为准。

© 2026 Plums