[wordpress插件] Adjacent Archive Links相邻存档链接

wordpress 插件 文章 2020-02-02 02:20 711 0 全屏看文

AI助手支持GPT4.0

评分

100

100

描述

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.

这两个标记都带有两个字符串参数,即 format link

The format parameter defines what comes before and after the link.

format 参数定义链接前后的内容。

In it, %link

其中,%link

will be replaced with whatever is declared in the link parameter below.

将被以下链接参数中声明的内容取代。

previous_archive_link

previous_archive_link

defaults to “«

默认为“ &laquo;

%link” and next_archive_link defaults to “%link »“.

%link ”和 next_archive_link 默认为“ %link&raquo; ”。

The link parameter defines the link text.

link 参数定义链接文本。

Both tags default to “%date“, the

这两个标签默认为“ %date ”,

adjacent archive page’s localized date.

相邻存档页面的本地化日期。

If you’re interested in contributing to the code behind this plugin, it’s also hosted on GitHub:

如果您有兴趣为该插件背后的代码做贡献,那么它也托管在GitHub上:

https://github.com/justincwatt/wp-adjacent-archive-links

https://github.com/justincwatt/wp-adjacent-archive-links

安装步骤

    1. Extract the zip file, drop the contents in your wp-content/plugins/ directory, and then activate from the Plugins page.
    2. 解压缩zip文件,将内容拖放到wp-content / plugins /目录中,然后从“插件”页面激活。

    3. Edit your theme file (e.g. archive.php) and add the template tags

    4. 编辑您的主题文件(例如archive.php)并添加模板标签。 <?php previous_archive_link();

      ?> and

      ?> <?php next_archive_link();

      ?>

    5. ?>

下载地址

https://downloads.wordpress.org/plugin/adjacent-archive-links.zip

https://downloads.wordpress.org/plugin/adjacent-archive-links.zip

-EOF-

AI助手支持GPT4.0