WordPress開發(fā)函數(shù)adjacent_post_link()
WordPress開發(fā)函數(shù)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' )
描述:
可以是下一篇文章鏈接或上一篇。
參數(shù):
$format
(string) (必需) 鏈接錨格式。
$link
(string) (必需) 永久鏈接格式的鏈接。
$in_same_term
(bool) (可選) 鏈接是否應該在同一個分類術語中。
默認值: false
$excluded_terms
(int[]|string) (可選) 被排除的類別id的數(shù)組或逗號分隔的列表。
默認值: ''
$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 );
}