previous_posts_link()
Displays the previous posts page link.
No Hooks.
Return
null
. Nothing (null).
Usage
previous_posts_link( $label );
- $label(string)
- Previous page link text.
Default: null
Examples
#1 Display a link to the previous block of posts on the category page:
<?php previous_posts_link(); ?>
#2 Change the link anchor to your own: "« move backward":
<?php previous_posts_link( '« move backwards' ) ?>
#3 Check if previous link exists
if( get_previous_posts_link() ) { previous_posts_link( '« Newer Entries' ); }
Changelog
Since 0.71 | Introduced. |
previous_posts_link() previous posts link code WP 6.7.1
function previous_posts_link( $label = null ) { echo get_previous_posts_link( $label ); }