Ready to get started?Download WordPress


How to display posts in the order I input them (2 posts)

  1. seanjacob
    Posted 3 years ago #

    So here is what I have so far, I want to display my posts with 44 first 18 second and 36 third. Is this possible?

    $the_query = new WP_Query( array( 'post__in' => array( 44, 18, 36 ) ) );
    if( have_posts() ) :
    while ($the_query->have_posts()) : $the_query->the_post();
  2. smoo
    Posted 3 years ago #

    I believe posts are displayed chronologically according to their 'published' date (which you can edit);

    You can display them first to last or last to first, by using &order=ASC or &order=DESC in the query_posts string (http://codex.wordpress.org/Function_Reference/query_posts), but I don't think you can choose the order in the way you have suggested above.

Topic Closed

This topic has been closed to new replies.

About this Topic