Title: Custom order of posts array
Last modified: August 20, 2016

---

# Custom order of posts array

 *  [jtsroberts](https://wordpress.org/support/users/jtsroberts/)
 * (@jtsroberts)
 * [14 years, 12 months ago](https://wordpress.org/support/topic/custom-order-of-posts-array/)
 * How can I order the pages for this array in a custom way instead of by title 
   ASC? ie. would something like ‘order’ = ‘5, 1, 26, 54’ work? (where the numbers
   are the post id’s).
 *     ```
       $args = array(
       'post_type' => 'page',
       'numberposts' => -1,
       'post_status' => null,
       'post_parent' => $post->ID,
       'order' => ASC,
       'orderby' => title);
       ```
   

Viewing 2 replies - 1 through 2 (of 2 total)

 *  [Michael](https://wordpress.org/support/users/alchymyth/)
 * (@alchymyth)
 * [14 years, 12 months ago](https://wordpress.org/support/topic/custom-order-of-posts-array/#post-2090180)
 * set the order in the ‘edit page’ page in admin, under ‘page attributes’ ‘order’;
 * then replace this in `$args`:
 * `'orderby' => title`
    with: `'orderby' => 'menu_order'`
 * [http://codex.wordpress.org/Function_Reference/WP_Query#Order_.26_Orderby_Parameters](http://codex.wordpress.org/Function_Reference/WP_Query#Order_.26_Orderby_Parameters)
 * (untested)
 *  Thread Starter [jtsroberts](https://wordpress.org/support/users/jtsroberts/)
 * (@jtsroberts)
 * [14 years, 11 months ago](https://wordpress.org/support/topic/custom-order-of-posts-array/#post-2090285)
 * Perfect 🙂
 * Even works with the My Page Order plugin.

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Custom order of posts array’ is closed to new replies.

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 2 replies
 * 2 participants
 * Last reply from: [jtsroberts](https://wordpress.org/support/users/jtsroberts/)
 * Last activity: [14 years, 11 months ago](https://wordpress.org/support/topic/custom-order-of-posts-array/#post-2090285)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
