Is is possible to override the set # of blog posts to show per page (as defined under Reading Settings in the WordPress admin)? I want to make it so a custom loop that I am using will show an unlimited number.

5 Answers
5

The argument that controls how many posts are shown in the query is posts_per_page

<?php query_posts( array( 
                         'post_type' => 'post',
                         'posts_per_page' => -1 ) 
      ); 
?>

Also to note is that there is a bug in the 3.0 branch which prevents the -1 integer from displaying all posts. It is fixed in 3.1 but a workaround would be to use a very high number instead of -1

see:

http://core.trac.wordpress.org/ticket/15150

Tags:

Leave a Reply

Your email address will not be published. Required fields are marked *