get_posts or wp_query? Most efficient option for multiple sections on 1 page?
-
Hi – I’ve read loads on this, some it contradicting, but want to figure out the best way to create various lists of posts on the same page for different categories in the most light-weight way (i.e. with minimum database hits).
The site I’m working on could loosely be described as a magazine style site with lots of posts in different categories.
On my homepage I intend there to be an image based grid of featured posts, followed by a row of ‘recent posts’ (with thumbnail and titles), followed by a list of 5 posts from one category (thumbnail, title, excepts and permalink) and then another list of posts from yet another category (with just titles and permalinks).
Which should I use: get_posts or wp-query for each bit?
Does it make a difference?
Is one more efficient than the other?OR should I somehow be making just one big query for everything and filtering that in different ways for the different sections / lists mentioned above? Can’t see this option working though as there will pretty quickly be hundreds and hundreds of posts.
I’d be really grateful for your input and thoughts! I’m keen to keep things as zippy as possible.
Thanks
Stef
- The topic ‘get_posts or wp_query? Most efficient option for multiple sections on 1 page?’ is closed to new replies.