Forums

[resolved] The Loop and orderby=ID (2 posts)

  1. creativelifeform
    Member
    Posted 2 years ago #

    Hi all,

    just a quick question. I have two posts within a category and need to order them via ID. I need the earlier post to appear before the later one. At the moment my code looks like this:

    <?php $my_query = new WP_Query('category_name=Practices&showposts=2&orderby=ID'); ?>

    But its not really working out how I want...the IDs for the each post are 19 and 16 respectively, and the 19th post is sitting above the 16th. I need it to be the other way around.

  2. creativelifeform
    Member
    Posted 2 years ago #

    Ah, order=ASC.

Topic Closed

This topic has been closed to new replies.

About this Topic