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?

1 Answer 1


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

  • Hey that's fantastic. Sorry I missed finding it for myself. Many Thanks
    – user4615
    Commented Apr 12, 2011 at 12:38

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.