tag

loop

When should you use WP_Query vs query_posts() vs get_posts()?

I recently came across a fantastic diagram by Rarst showing the difference between WP_Query(), query_posts() and get_posts(). As you may know, these are all ways of retrieving posts in WordPress, but they are not all equal.

Stay up-to-date with the Mayor
Sign up to receive one weekly email about our latest reviews, tutorials, giveaways and more.