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|void) 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 ) {
	$output = esc_url( get_previous_posts_page_link() );

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