[wp-hackers] limiting the number of posts
halukkaramete at gmail.com
Thu Jan 30 19:36:57 UTC 2014
Simon, you are absolutely right.
I got confused between the numberposts, number_of_posts, showposts,
posts_per_page, foundposts. I definitely overlooked.
Thank you for nailing it for me.
On Thu, Jan 30, 2014 at 11:12 AM, Simon Blackbourn <piemanek at gmail.com>wrote:
> > posts_per_page does not have anything to do with the LIMIT phrase of
> > What query argument corresponds to the LIMIT?
> > In other words, I'd like WordPress query to return only 3 posts max,
> > though there could be thousands that match that query. )
> I think you've got it wrong: if you pass a value of 3 as the posts_per_page
> argument into get_posts or a new WP_Query and inspect the query that is
> run, it will show "LIMIT 0, 3".
> Try the Query Monitor plugin (http://wordpress.org/plugins/query-monitor),
> it outputs nicely formatted SQL of all your database queries.
> wp-hackers mailing list
> wp-hackers at lists.automattic.com
More information about the wp-hackers