ifacethoughts

posts_per_page

Wordpress allows configuration for setting the number of posts to be displayed whenever an index archive (the typical homepage) or other archives like category or monthly archives are displayed. This option can be configured in the Blog Pages field Reading tab under Options menu in the administration User Interface. Note that there is a separate field for configuration number of posts to be displayed for syndication (feeds).

posts_per_page is set in the method get_posts of WP_Query.

Plugin and theme authors need not access this global variable directly. Wordpress uses it internally to calculate the number of posts to be displayed.

Since the same setting is used for all archives Matt Read has developed a plugin where posts per page setting can be set for different types of archives, e.g., search, category, home, monthly, yearly, etc.

Back to full list of global variables.

Technorati tags: ,

Discussion [Participate or Link]

  1. Abhijit Nadgouda’s List of WordPress Global Variables « Lorelle on WordPress said:

    [...] Post and Page Variables: wp_query, posts, more, posts_per_page, max_num_pages, numpages, page, pages, multipage, paged, post, id, authordata, post_cache, category_cache, and post_meta_cache [...]

  2. Wordpress Global Variables | iface thoughts said:

    [...] $posts_per_page [...]

Say your thought!

Who are you?

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.

freshthoughts

freshcomments

contactme

Abhijit Nadgouda
iface Consulting
India
+91 9819820312
Y!: anadgouda
GTalk: anadgouda@gmail.com
MSN: anadgouda@hotmail.com
Skype: anadgouda
My bookmarks

currentproject

Complete Wellbeing

badgesand...

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.

Twitter - Trying out sakura terminal - http://www.pleyades.net/david/sakura.php