[wp-hackers] next_posts_link's parameter $max_posts

DD32 wordpress at dd32.id.au
Thu Aug 14 07:40:33 GMT 2008

Looking at the source, Its designed to limit the amount of "Next page"  

next_posts_link('next page', 3);
If theres 10 pages of results, it would show the link on the first 3  
pages, But the 4th and onwards would not have the link.

If its not set, Then it automatically gets set to the number of pages in  
the current result set, So it'd link on page 9, but not 10 (as theres no  
11th page)

On Thu, 14 Aug 2008 17:35:43 +1000, Lutz Schröer <latz at elektroelch.de>  

> Hi,
> during answering some support questions I ran across a mysterious
> parameter of the next_posts_link function:
> function next_posts_link($label='Next Page &raquo;', $max_page=0)
> What's the $max_page parameter for? In the function itself the parameter
> will be set the following way:
> if ( !$max_page ) {
>         $max_page = $wp_query->max_num_pages;
>     }
> Is it only a relict or is there a meaningful scenario to use this
> parameter? The Codex skips the explanation...
> lutz
> _______________________________________________
> wp-hackers mailing list
> wp-hackers at lists.automattic.com
> http://lists.automattic.com/mailman/listinfo/wp-hackers

More information about the wp-hackers mailing list