Limit the max number of post show in the index page in wordpress
you know that by default wordpress 开发者_如何学编程shows 10 post in the index page, i need to show 20, where can i modify this? Thanks!
This is very easy to do from your WordPress admin panel.
Go to Settings -> Reading -> and then simply change the number in the box next to the question "Blog pages show at most".
Let me know if that answers your question or not!
You would adjust your theme's Loop to look as follows:
<?php
query_posts($query_string.'&posts_per_page=20');
while(have_posts()) { the_post();
<!-- put your loop code here -->
}
?>
This would limit to 20 posts instead of 10.
精彩评论