On this page
get_next_posts_page_link( int $max_page ): string|void
Retrieves the next posts page link.
Description
Backported from 2.1.3 to 2.0.10.
Parameters
$max_pageint Optional-
Max pages. Default 0.
Return
string|void The link URL for next posts page.
Source
File: wp-includes/link-template.php. View all references
function get_next_posts_page_link( $max_page = 0 ) {
global $paged;
if ( ! is_single() ) {
if ( ! $paged ) {
$paged = 1;
}
$nextpage = (int) $paged + 1;
if ( ! $max_page || $max_page >= $nextpage ) {
return get_pagenum_link( $nextpage );
}
}
}
Related
Uses
| Uses | Description |
|---|---|
| is_single() wp-includes/query.php | Determines whether the query is for an existing single post. |
| get_pagenum_link() wp-includes/link-template.php | Retrieves the link for a page number. |
Used By
| Used By | Description |
|---|---|
| next_posts() wp-includes/link-template.php | Displays or retrieves the next posts page link. |
Changelog
| Version | Description |
|---|---|
| 2.0.10 | Introduced. |
© 2003–2022 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/functions/get_next_posts_page_link