WordPress功能函数adjacent_post_link()

WordPress功能函数adjacent_post_link(),显示相邻的post链接。

用法:

adjacent_post_link( string $format, string $link, bool $in_same_term = false, int[]|string $excluded_terms = ”, bool $previous = true, string $taxonomy = ‘category’ )

描述:

可以是下一篇文章链接或上一篇。

参数:

$format

(string) (必需) 链接锚格式。

$link

(string) (必需) 永久链接格式的链接。

$in_same_term

(bool) (可选) 链接是否应该在同一个分类术语中。

默认值: false

$excluded_terms

(int[]|string) (可选) 被排除的类别id的数组或逗号分隔的列表。

默认值: ”

$previous

(bool) (可选) 显示上一篇文章的链接还是下一篇文章的链接。

默认值: true

$taxonomy

(string) (可选) 分类,如果$in_same_term为真。

默认值: ‘category’

来源:

文件: wp-includes/link-template.php

function adjacent_post_link( $format, $link, $in_same_term = false, $excluded_terms = ”, $previous = true, $taxonomy = ‘category’ ) {

echo get_adjacent_post_link( $format, $link, $in_same_term, $excluded_terms, $previous, $taxonomy );

}

更新日志:

WordPress功能函数adjacent_post_link() (https://www.wp-admin.cn/) WordPress开发教程 第1张

相关推荐

发表回复

房先生
我们将24小时内回复。
2024-05-11 05:20:55
您好,有任何疑问请与我们联系!
您的工单我们已经收到,我们将会尽快跟您联系!
[QQ客服]
2781198
加我微信
[电话联系]
13585372227
[电子邮件]
chaoneo@163.com
取消

选择聊天工具: