next_posts()
Displays or retrieves the next posts page link.
No Hooks.
Returns
String|null. The link URL for next posts page if $display = false.
Usage
next_posts( $max_page, $display );
- $max_page(int)
- Max pages.
- $display(true|false)
- Whether to echo the link.
Default:true
Changelog
| Since 0.71 | Introduced. |
next_posts() next posts code WP 7.0
function next_posts( $max_page = 0, $display = true ) {
$link = get_next_posts_page_link( $max_page );
$output = $link ? esc_url( $link ) : '';
if ( $display ) {
echo $output;
} else {
return $output;
}
}