A WordPress-centric search engine for devs and theme authors



previous_posts ›

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

Displays or retrieves the previous posts page link.



Source

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

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