21 comments

  1. Klemen

    Comic Sans, really?

  2. Heiner

    Thank you for this overview! Some of our junior programmers have problems with the query functions of WP.

  3. Rakesh Kumar

    This errors really annoy me and I realize that if were a developer may i can fix these problem. By the way my theme gives an error that header could not be modify!!!. What is that?

  4. Charleston

    This is my first encounter of wordpress stack exchange and I must say that your illustration do clear up some of my query. Thanks for the info again Rarst.

  5. finchamgroves

    That’s really great! I’ve been going around in circles for hours on the differences between these queries . At last something clear!
    There do seem to be variations in how people set up a new instances of WP_Query(). Is just this OK?
    new WP_Query()

    Some people seem to use this and I’m not sure why.
    $myqueryname = $wp_query;
    $wp_query = null;
    $wp_query = new WP_Query();
    then off into loopy stuff…

  6. finchamgroves

    @Rarst

    Many thanks. (It slows me down no end but I hate just using stuff without questioning why!)

  7. finchamgroves

    Is there a difference between wp_reset_postdata() and rewind_posts() ?
    It’s hard to find a comparison in the codex.

  8. Marcko

    Thank you for this overview

  9. kaiser

    One thing i really can’t understand: Why wordpress devs *never* make use of the error object to help people. I don’t know how often I’ve read the following sentence from “Otto”, who’s in the core dev team: “Then you’re doing it wrong(tm)”. I tend to say that I must have done something wrong, if the user couldn’t do it right. If you take a look at one of my plugins “easy pagination deamon”, then you’ll find the function “help()” inside the class that notifies the user if the template tag wasn’t placed right. It makes me close to angry, because i know there’s – aside from the error class – another useful function inside core: “_doing_it_wrong( $function, $message, $version )” – /core-root/wp-includes/functions.php…

  10. kaiser

    @Rarst

    But afaik the error class is there since a much longer time… ;)

    Btw: Why don’t you use threaded comments? Haven’t ever seen a reply in the style you use it over here before.

  11. Chris Olbekson

    I’m doing a talk at WordCamp Austin later this month about WP Query functions and would like to reference your flow chart. I was also thinking about updating it with pre_get_posts and is_main_query based on Nacin’s recent presentation.

  12. Vladimir

    So what should I use? get_posts or wp_query I just prefer get_posts and not fully understood it is better

Leave a Reply

You must be logged in to post a comment.

Subscribe to followup comments via RSS