posts_nav_link

Displays the post pages link navigation for previous and next pages.

Description

posts_nav_link( (string) $sep = '', (string) $prelabel = '', (string) $nxtlabel = '' ); 

Parameters (3)

0. $sep — Optional. (string) => ''
Separator for posts navigation links. Default empty.
1. $prelabel — Optional. (string) => ''
Label for previous pages. Default empty.
2. $nxtlabel — Optional. (string) => ''
Label for next pages. Default empty.

Usage

  1. if ( !function_exists( 'posts_nav_link' ) ) { 
  2. require_once ABSPATH . WPINC . '/link-template.php'; 
  3.  
  4. // Optional. Separator for posts navigation links. Default empty. 
  5. $sep = ''; 
  6.  
  7. // Optional. Label for previous pages. Default empty. 
  8. $prelabel = ''; 
  9.  
  10. // Optional Label for next pages. Default empty. 
  11. $nxtlabel = ''; 
  12.  
  13. // NOTICE! Understand what this does before running. 
  14. $result = posts_nav_link($sep, $prelabel, $nxtlabel); 
  15.  

Defined (1)

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

/wp-includes/link-template.php  
  1. function posts_nav_link( $sep = '', $prelabel = '', $nxtlabel = '' ) { 
  2. $args = array_filter( compact('sep', 'prelabel', 'nxtlabel') ); 
  3. echo get_posts_nav_link($args);