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:

Discussion [Participate or Link]

  1. WeCode said:

    Thanks for the tip i was wondering what is the setting value of max_num_pages lucky that i found u’r article. Thx again

Say your thought!

If you want to use HTML you can use these tags: <a>, <em>, <strong>, <abbr>, <code>, <blockquote>. Closing the tags will be appreciated as this site uses valid XHTML.



Abhijit Nadgouda
iface Consulting
+91 9819820312
My bookmarks


This is the weblog of Abhijit Nadgouda where he writes down his thoughts on software development and related topics. You are invited to subscribe to the feed to stay updated or check out more subscription options. Or you can choose to browse by one of the topics.