Title: Where to implement PHP OrderBy &amp; Order
Last modified: August 22, 2016

---

# Where to implement PHP OrderBy & Order

 *  [intrepid.yellow](https://wordpress.org/support/users/intrepidyellow/)
 * (@intrepidyellow)
 * [11 years, 4 months ago](https://wordpress.org/support/topic/where-to-implement-php-orderby-order/)
 * Hi,
 * I have a slider of sorts running on my site. It pulls posts of a certain criteria
   in to it. This all works no problems!
 * I want the posts to Order, ASC and OrderBy, ID.
 * Can someone help me with the snippet of code I need to insert and where exactly?
 * From support documentation I think it’s something like this:
 *  $args = array( ‘order’=> ‘ASC’, ‘orderby’ => ‘id’ );
    query_posts( $args );
 * But I popped it in in a couple of different spots / variations of calling $args
   and haven’t had any luck.
 * I know it’ll be a one minute solve for someone fluent in PHP.
 * THANKS! (in advance)
 * [Large code excerpt removed by moderator per [forum rules](https://codex.wordpress.org/Forum_Welcome#Posting_Code).
   Please use [the pastebin](http://wordpress.pastebin.com/) for all large code 
   excerpts. It works better anyway.]

Viewing 1 replies (of 1 total)

 *  Thread Starter [intrepid.yellow](https://wordpress.org/support/users/intrepidyellow/)
 * (@intrepidyellow)
 * [11 years, 4 months ago](https://wordpress.org/support/topic/where-to-implement-php-orderby-order/#post-5877356)
 * [http://pastebin.com/xqzgrfu4](http://pastebin.com/xqzgrfu4)

Viewing 1 replies (of 1 total)

The topic ‘Where to implement PHP OrderBy & Order’ is closed to new replies.

## Tags

 * [args](https://wordpress.org/support/topic-tag/args/)
 * [array](https://wordpress.org/support/topic-tag/array/)
 * [order](https://wordpress.org/support/topic-tag/order/)
 * [orderby](https://wordpress.org/support/topic-tag/orderby/)
 * [php](https://wordpress.org/support/topic-tag/php/)
 * [query](https://wordpress.org/support/topic-tag/query/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 1 reply
 * 1 participant
 * Last reply from: [intrepid.yellow](https://wordpress.org/support/users/intrepidyellow/)
 * Last activity: [11 years, 4 months ago](https://wordpress.org/support/topic/where-to-implement-php-orderby-order/#post-5877356)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
