开发者

WP_Query default number of posts

Is that true that WP_Query by default returns 10 posts? I have more than 10 posts and didn't set the post_count variable and it returned 10 posts. Then I set post_count to 1000 and it returned all posts (Now I have 27 posts for test purposes). Then I read some documentation and learned from there that I can set post_count=-1 to return all posts. I tried and it worked. But I couldn't find an explanation if it's fine开发者_开发知识库 that it returns 10 posts by default. Thanks.


Yes, the default is 10 posts. You should have a look at the documentation for The Loop. That will help you get a better understanding of how this works.

http://codex.wordpress.org/The_Loop


Yes. The default number of posts is 10.

The easiest way to change this is in Settings after logging in Wordpress administrator.

You will see: Maximum number of posts to show in this site: 10

Change it !! And the maximun numbers of feeds if you want.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜