Support » Fixing WordPress » WP_Query output but in order

  • Greets:

    I’m sitting here looking at teh code for the Recent Posts widget and I have a question about Wp_Query. Here’s the code used in the widget:

    $r = new WP_Query('showposts=10');
    if ($r->have_posts()) :

    I’ve also read teh codex on the function but did not find my answer:

    Function_Reference/WP_Query

    I don’t find nay mention of showposts over there either so I’m kind of scratching my head.

    My main question though is there anyway to out put in an alphbetical list using this function call?

    As an aside, is there a better description on how to use this function and what configuations can be used with it?

    Thanks,
    -drmike

Viewing 5 replies - 1 through 5 (of 5 total)
  • Don’t quote me on this… but seemingly it is using the same parameters as query_posts, so you may want to experiment with the “orderby=name&order=ASC”

    I found simularities in that function as well and was wondering the same thing.

    My long term goal for this is to create a Page Template that lists the titles and links for all of the posts within a blog and this appears to be to me at least the best method to do so. Is there something better to use?

    Thanks,
    -drmike

    What about the “classic” archives.php and a plugin like the clean_archives_reloaded by viper007?

    Not sure what you mean by classic’s archives.php as I don’t see one in there. Default has one but it lists months and catgeories where we want a list of just post titles and links to those posts.

    Not sure about Vipers but I’ll go take a look.

    Thanks,
    -drmike

    Oops, his site is down. Hope the plugin is on the codex db. 🙂

    And no it’s not. 🙁

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘WP_Query output but in order’ is closed to new replies.