previous_posts() WordPress Function
The previous_posts() function is used to display a link to the previous set of posts, if available. This is typically used within a WordPress loop.
previous_posts( bool $echo = true ) #
Displays or retrieves the previous posts page link.
Parameters
- $echo
(bool)(Optional) Whether to echo the link.
Default value: true
Return
(string|void) The previous posts page link if $echo = false.
Source
File: wp-includes/link-template.php
function previous_posts( $echo = true ) {
$output = esc_url( get_previous_posts_page_link() );
if ( $echo ) {
echo $output;
} else {
return $output;
}
}
Expand full source codeCollapse full source codeView on TracView on GitHub
Changelog
| Version | Description |
|---|---|
| 0.71 | Introduced. |