On this page
previous_posts( bool $echo = true ): string|void
Displays or retrieves the previous posts page link.
Parameters
$echobool Optional-
Whether to echo the link.
Default:
true
Return
string|void The previous posts page link if $echo = false.
Source
File: wp-includes/link-template.php. View all references
function previous_posts( $echo = true ) {
$output = esc_url( get_previous_posts_page_link() );
if ( $echo ) {
echo $output;
} else {
return $output;
}
}
Related
Uses
| Uses | Description |
|---|---|
| get_previous_posts_page_link() wp-includes/link-template.php | Retrieves the previous posts page link. |
| esc_url() wp-includes/formatting.php | Checks and cleans a URL. |
Used By
| Used By | Description |
|---|---|
| get_previous_posts_link() wp-includes/link-template.php | Retrieves the previous posts page link. |
Changelog
| Version | Description |
|---|---|
| 0.71 | Introduced. |
© 2003–2022 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/functions/previous_posts