WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Reorder my Blog Posts? (4 posts)

  1. sincewelastspoke
    Member
    Posted 3 years ago #

    Hi,

    I have the following code in my page.php.
    http://pastebin.com/U5Y4NJ3J

    It currently loops through a set of posts, however I want to change the order they appear.

    How do I do this?

    Many thanks!

  2. esmi
    Forum Moderator
    Posted 3 years ago #

    It would help if we could see your custom query.

  3. sincewelastspoke
    Member
    Posted 3 years ago #

    You're right, it would :)

    $args = array(
      'category__in'     => '3',
      'caller_get_posts' => 1
    );
    
    if ( $paged > 1 ) {
      $args['paged'] = $paged;
    }
    
    $my_query = new WP_Query($args);

    I'm guessing I would just the Orderby info to my current $args array?

    How silly of me to miss this.

  4. esmi
    Forum Moderator
    Posted 3 years ago #

    In case anyone else is interested orderby will let you change the sorting criteria and order will allow you to use either ASC or DESC (ascending or descending).

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.