get_previous_posts_page_link

Retrieves the previous posts page link.

Description

(string|void) get_previous_posts_page_link(); 

Will only return string, if not on a single page or post.

Backported to 2.0.10 from 2.1.3.

Returns (string|void)

The link for the previous posts page.


Usage

  1. if ( !function_exists( 'get_previous_posts_page_link' ) ) { 
  2. require_once ABSPATH . WPINC . '/link-template.php'; 
  3.  
  4.  
  5. // NOTICE! Understand what this does before running. 
  6. $result = get_previous_posts_page_link(); 
  7.  

Defined (1)

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

/wp-includes/link-template.php  
  1. function get_previous_posts_page_link() { 
  2. global $paged; 
  3.  
  4. if ( !is_single() ) { 
  5. $nextpage = intval($paged) - 1; 
  6. if ( $nextpage < 1 ) 
  7. $nextpage = 1; 
  8. return get_pagenum_link($nextpage);