Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

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

1 Answer 1

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

 
discard

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