WordPress功能函數(shù)adjacent_posts_rel_link()
WordPress功能函數(shù)adjacent_posts_rel_link(),顯示與當前文章相鄰的文章的關系鏈接。
用法:
adjacent_posts_rel_link( string $title = '%title', bool $in_same_term = false, int[]|string $excluded_terms = '', string $taxonomy = 'category' )
參數(shù):
$title
(string) (可選) 鏈接標題格式。
默認值: '%title'
$in_same_term
(bool) (可選) 鏈接是否應該在同一個分類術語中。
默認值: false
$excluded_terms
(int[]|string) (可選) 被排除的術語id的數(shù)組或逗號分隔的列表。
默認值: ''
$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 );
}