get_next_posts_link WordPress Function

Description
Gets a link to the previous set of posts within the current query.

Because post queries are usually sorted in reverse chronological order, get_next_posts_link() usually points to older entries (toward the end of the set) and get_previous_posts_link() usually points to newer entries (toward the beginning of the set).

Note: See Troubleshooting Broken Pagination if you have pagination issues.

Usage

 
<?php echo get_next_posts_link( $label, $max_page ); ?>

 

Parameters
$label
(string) (optional) The content for the link text
Default: Next Page »
$max_page
(int) (optional) Limit the number of pages on which the link is displayed. The default value “0” means “no limit”.
Default: 0
Return Values
Link to next page if successful, otherwise null.
Default Usage

 

<?php echo get_next_posts_link(); ?>

Leave a Reply

Your email address will not be published. Required fields are marked *