WordPress.org

Ready to get started?Download WordPress

Forums

WP_Query output but in order (6 posts)

  1. drmike
    Member
    Posted 7 years ago #

    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

  2. moshu
    Member
    Posted 7 years ago #

    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"

  3. drmike
    Member
    Posted 7 years ago #

    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

  4. moshu
    Member
    Posted 7 years ago #

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

  5. drmike
    Member
    Posted 7 years ago #

    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. :)

  6. drmike
    Member
    Posted 7 years ago #

    And no it's not. :(

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags