get_next_posts_page_link

Retrieves the next posts page link.

Description

(string|void) get_next_posts_page_link( (int) $max_page = 0 ); 

Backported from 2.1.3 to 2.0.10.

Returns (string|void)

The link URL for next posts page.

Parameters (1)

0. $max_page — Optional. (int)
Max pages. Default 0.

Usage

  1. if ( !function_exists( 'get_next_posts_page_link' ) ) { 
  2. require_once ABSPATH . WPINC . '/link-template.php'; 
  3.  
  4. // Optional. Max pages. Default 0. 
  5. $max_page = -1; 
  6.  
  7. // NOTICE! Understand what this does before running. 
  8. $result = get_next_posts_page_link($max_page); 
  9.  

Defined (1)

The function is defined in the following location(s).

/wp-includes/link-template.php  
  1. function get_next_posts_page_link($max_page = 0) { 
  2. global $paged; 
  3.  
  4. if ( !is_single() ) { 
  5. if ( !$paged ) 
  6. $paged = 1; 
  7. $nextpage = intval($paged) + 1; 
  8. if ( !$max_page || $max_page >= $nextpage ) 
  9. return get_pagenum_link($nextpage);