previous_posts_link() WordPress Function

The previous_posts_link() function in WordPress is used to display a link to the previous set of posts, if available. This is typically used in conjunction with the next_posts_link() function to create a set of links for navigating between posts.

previous_posts_link( string $label = null ) #

Displays the previous posts page link.


Parameters

$label

(string)(Optional) Previous page link text.

Default value: null


Top ↑

More Information

If you need the values for use in PHP, use get_previous_posts_link().

Because post queries are usually sorted in reverse chronological order, next_posts_link() usually points to older entries (toward the end of the set) and previous_posts_link() usually points to newer entries (toward the beginning of the set).


Top ↑

Source

File: wp-includes/link-template.php

function previous_posts_link( $label = null ) {
	echo get_previous_posts_link( $label );
}


Top ↑

Changelog

Changelog
VersionDescription
0.71Introduced.

The content displayed on this page has been created in part by processing WordPress source code files which are made available under the GPLv2 (or a later version) license by theĀ Free Software Foundation. In addition to this, the content includes user-written examples and information. All material is subject to review and curation by the WPPaste.com community.

Show More
Show More