首页 WordPress函数大全 get_previous_post_link()

get_previous_post_link()

2020-05-01 / 3694阅 / 悠然

如何你看完本文还不知道如何使用该函数,可以联系我定制视频教程,50元/个函数,学不会全额退款

get_previous_post_link( string $format = '« %link', string $link = '%title', bool $in_same_term = false, array|string $excluded_terms = '', string $taxonomy = 'category' )

Retrieves the previous post link that is adjacent to the current post.

描述

参数

$format

(string)
(Optional)
Link anchor format. Default '« %link'.

Default value: '« %link'

$link

(string)
(Optional)
Link permalink format.

Default value: '%title'

$in_same_term

(bool)
(Optional)
Whether link should be in a same taxonomy term.

Default value: false

$excluded_terms

(array|string)
(Optional)
Array or comma-separated list of excluded term IDs.

Default value: ''

$taxonomy

(string)
(Optional)
Taxonomy, if $in_same_term is true.

Default value: 'category'

返回

(string) The link URL of the previous post in relation to the current post.

大家谈论
    我的见解