3D-kreativ
3D-kreativ

Reputation: 9299

WordPress doesn't show all posts

Is there a reason why WP only shows a list of 10 posts? I'm using this code $latestPosts = new WP_Query('cat=5'); to get a list of all posts that I have. I thought this should work, compared to this code: $latestPosts = new WP_Query('cat=5&posts_per_page=3'); with a limit of 3 posts.

I have 19 posts, but in the list I only get 10. Is there some kind of pagination by default that I have to handle in the code?

Upvotes: 0

Views: 362

Answers (1)

jono
jono

Reputation: 1842

Change the posts_per_page value to -1

Upvotes: 1

Related Questions