max_num_pages

max_num_pages represents the number of pages when any WordPress archive is displayed. It is set using the posts_per_page global variable. It is calculated and set in the functions next_posts_link($label=’Next Page »’, $max_page = 0) and posts_nav_link($sep=’ — ‘, $prelabel=’« Previous Page’, $nxtlabel=’Next Page »’) defined in [wordpress root folder]/wp-includes/template-functions-links.php.

WordPress uses this global variable internally to create the next and previous links for navigation in an archive. Plugin and theme authors need not access this global variable directly.

Back to full list of global variables.

Technorati tags:

Leave a Reply