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
if ( !function_exists( 'get_previous_posts_page_link' ) ) { require_once ABSPATH . WPINC . '/link-template.php'; } // NOTICE! Understand what this does before running. $result = get_previous_posts_page_link();
Defined (1)
The function is defined in the following location(s).
- /wp-includes/link-template.php
- function get_previous_posts_page_link() {
- global $paged;
- if ( !is_single() ) {
- $nextpage = intval($paged) - 1;
- if ( $nextpage < 1 )
- $nextpage = 1;
- return get_pagenum_link($nextpage);
- }
- }