Uses
Uses | Description |
---|---|
wp-includes/link-template.php: get_previous_post_link() | Retrieves the previous post link that is adjacent to the current post. |
Displays the previous post link that is adjacent to the current post.
(string) (Optional) Link anchor format. Default '« %link'.
Default value: '« %link'
(string) (Optional) Link permalink format.
Default value: '%title'
(bool) (Optional) Whether link should be in a same taxonomy term.
Default value: false
(array|string) (Optional) Array or comma-separated list of excluded term IDs.
Default value: ''
(string) (Optional) Taxonomy, if $in_same_term is true.
Default value: 'category'
Used on single post permalink pages, this template tag displays a link to the previous post which exists in chronological order from the current post. This tag must be used in The Loop.
$format is the ormat string for the link. This is where to control what comes before and after the link. '%link' in string will be replaced with whatever is declared as 'link' (see next parameter). 'Go to %link' will generate “Go to <a href=…” Put HTML tags here to style the final results.
File: wp-includes/link-template.php
function previous_post_link( $format = '« %link', $link = '%title', $in_same_term = false, $excluded_terms = '', $taxonomy = 'category' ) { echo get_previous_post_link( $format, $link, $in_same_term, $excluded_terms, $taxonomy ); }
Version | Description |
---|---|
1.5.0 | Introduced. |
© 2003–2019 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/functions/previous_post_link