Displays the next post link that is adjacent to the current post.
$formatstringoptional
Default:'%link »'
$linkstringoptional
'%title'.Default:'%title'
$in_same_termbooloptional
Default:false
$excluded_termsint[]|stringoptional
Default:''
$taxonomystringoptional
$in_same_term is true. Default 'category'.Default:'category'
function next_post_link( $format = '%link »', $link = '%title', $in_same_term = false, $excluded_terms = '', $taxonomy = 'category' ) {
echo get_next_post_link( $format, $link, $in_same_term, $excluded_terms, $taxonomy );
}
| Version | Description |
|---|---|
| 1.5.0 | Introduced. |
© 2003–2024 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/functions/next_post_link