previous_posts

Displays or retrieves the previous posts page link.

Description

(string|void) previous_posts( (bool) $echo = true ); 

Returns (string|void)

The previous posts page link if `$echo = false`.

Parameters (1)

0. $echo — Optional. (bool) => true
Whether to echo the link. Default true.

Usage

  1. if ( !function_exists( 'previous_posts' ) ) { 
  2. require_once ABSPATH . WPINC . '/link-template.php'; 
  3.  
  4. // Optional. Whether to echo the link. Default true. 
  5. $echo = true; 
  6.  
  7. // NOTICE! Understand what this does before running. 
  8. $result = previous_posts($echo); 
  9.  

Defined (1)

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

/wp-includes/link-template.php  
  1. function previous_posts( $echo = true ) { 
  2.  
  3. if ( $echo ) 
  4. echo $output; 
  5. else 
  6. return $output;