wpseek.com
A WordPress-centric search engine for devs and theme authors



previous_posts › WordPress Function

Since0.71
Deprecatedn/a
previous_posts ( $display = true )
Parameters:
  • (bool) $display Optional. Whether to echo the link. Default true.
    Required: No
    Default: true
Returns:
  • (string|null) The previous posts page link if `$display = false`.
Defined at:
Codex:

Displays or retrieves the previous posts page link.



Source

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

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