close

previous_posts( bool $display = true ): string|null

In this article

Displays or retrieves the previous posts page link.

Parameters

$displaybooloptional
Whether to echo the link.

Default:true

Return

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

Source

function previous_posts( $display = true ) {
	$link   = get_previous_posts_page_link();
	$output = $link ? esc_url( $link ) : '';

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

Changelog

VersionDescription
0.71Introduced.

User Contributed Notes

You must log in before being able to contribute a note or feedback.