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: max_num_pages