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



next_posts › WordPress Function

Since0.71
Deprecatedn/a
next_posts ( $max_page = 0, $display = true )
Parameters: (2)
  • (int) $max_page Optional. Max pages. Default 0.
    Required: No
    Default:
  • (bool) $display Optional. Whether to echo the link. Default true.
    Required: No
    Default: true
Returns:
  • (string|void) The link URL for next posts page if `$display = false`.
Defined at:
Codex:

Displays or retrieves the next posts page link.



Source

function next_posts( $max_page = 0, $display = true ) {
	$link   = get_next_posts_page_link( $max_page );
	$output = $link ? esc_url( $link ) : '';

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