previous_posts()WP 0.71

Displays or retrieves the previous posts page link.

No Hooks.

Return

String|null. The previous posts page link if $display = false.

Usage

previous_posts( $display );
$display(true|false)
Whether to echo the link.
Default: true

Changelog

Since 0.71 Introduced.

previous_posts() code WP 6.4.3

function previous_posts( $display = true ) {
	$output = esc_url( get_previous_posts_page_link() );

	if ( $display ) {
		echo $output;
	} else {
		return $output;
	}
}