previous_post_link()
previous_post_link( string $format = ‘« %link’, string $link = ‘%title’, bool $in_same_term = false, array|string $excluded_terms = ”, string $taxonomy = ‘category’ )
显示与当前文章相邻的上一篇文章链接。
Displays the previous post link that is adjacent to the current post.
说明(Description)
参数(Parameters)
参数 | 类型 | 必填 | 说明 |
---|---|---|---|
$format | (string) | 可选 | 链接定位格式。默认“~%链接”。 |
$link | (string) | 可选 | 链接永久链接格式。 |
$in_same_term | (bool) | 可选 | 链接是否应该在同一个分类术语中。 |
$excluded_terms | (array | string) | 可选 | 排除的术语ID的数组或逗号分隔列表。 |
$taxonomy | (string) | 可选 | 分类法,如果$in_相同的术语是真的。 |
返回(Return)
无返回值
源码(Source)
更新版本 | 源码位置 | 使用 | 被使用 |
---|---|---|---|
1.5.0 | wp-includes/link-template.php:2101 | 0 | 1 function |
笔记(Notes)
文章标题作为链接,在相同的自定义分类中
粗体文章标题作为链接
默认用法
previous_post_link() 为WP2原创文章,链接:https://www.wp2.cn/functions/previous_post_link/