当前位置:首页>网络教程>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 );

}

更新日志:

WordPress功能函数adjacent_posts_rel_link()

给TA打赏
共{{data.count}}人
人已打赏
网络教程

WordPress开发函数adjacent_image_link()

2022-7-15 16:58:00

网络教程

WordPress功能函数adjacent_posts_rel_link_wp_head()

2022-7-15 16:58:21

0 条回复 A文章作者 M管理员
    暂无讨论,说说你的看法吧
个人中心
购物车
优惠劵
今日签到
有新私信 私信列表
搜索