WordPress开发函数adjacent_posts_rel_link()

WordPress开发函数adjacent_posts_rel_link(),显示与当前文章相邻

WordPress开发函数adjacent_posts_rel_link()

WordPress开发函数adjacent_posts_rel_link(),显示与当前文章相邻的文章的关系链接。
用法:
adjacent_posts_rel_link( string $title = \’%title\’, bool $in_same_term = false, int[]|string $excluded_terms = \’\’, string $taxonomy = \’category\’ )
参数:
$title
(string) (可选) 链接标题格式。
默认值: \’%title\’
$in_same_term
(bool) (可选) 链接是否应该在同一个分类术语中。
默认值: false
$excluded_terms
(int[]|string) (可选) 被排除的术语id的数组或逗号分隔的列表。
默认值: \’\’
$taxonomy
(string) (可选) 分类,如果$in_same_term为真。
默认值: \’category\’
来源:
文件: wp-includes/link-template.php
function adjacent_posts_rel_link( $title = \’%title\’, $in_same_term = false, $excluded_terms = \’\’, $taxonomy = \’category\’ ) {
echo get_adjacent_post_rel_link( $title, $in_same_term, $excluded_terms, true, $taxonomy );
echo get_adjacent_post_rel_link( $title, $in_same_term, $excluded_terms, false, $taxonomy );
}
更新日志:

作者: liuzhihao

为您推荐

返回顶部