WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] how to change order by (4 posts)

  1. antishape
    Member
    Posted 2 years ago #

    I am using this code and want the post appear order by post_title, any ideas?

    http://pastebin.com/UKzpZ6BX

  2. Harry
    Member
    Posted 2 years ago #

    $args=array(
           'cat' => $catid,
           'paged' => $paged,
           'orderby' => 'title'
      );

    Codex Reference Here

  3. antishape
    Member
    Posted 2 years ago #

    Thank you! Guess it was confusing to see $catid instead of 'catid' so I thought it would be wrong to place it here.

  4. Harry
    Member
    Posted 2 years ago #

    $catid is just a variable I use to set the category, you could manually define it, like 'cat' => 3,4,5 etc.

    Mainly, I think I was pointing out the 'orderby' attribute you can define.

Topic Closed

This topic has been closed to new replies.

About this Topic