WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am struggling to understand how queries work with get_posts(), query_posts() and WP_Query(). In particular I do not understand what pre-existing selection may exist when using these on a given page template. From various blogs it seems that the default situation is that query_posts() and WP_Query() apply any pre-existing filters whilst get_posts supresses them. However the codex says query_posts() ignores other parameters it receives via the URL (such as page number or category.) Are these filters / parameters the same or something different? How can I definitively tell what pre-existing selection will exist when I create a query?

share|improve this question

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

share|improve this answer
Hey that's fantastic. Sorry I missed finding it for myself. Many Thanks – user4615 Apr 12 '11 at 12:38

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.