Title: Issue with admin page sorting
Last modified: August 31, 2016

---

# Issue with admin page sorting

 *  [olie480](https://wordpress.org/support/users/olie480/)
 * (@olie480)
 * [10 years, 4 months ago](https://wordpress.org/support/topic/issue-with-admin-page-sorting/)
 * Hello, we recently had an issue where the Post Types Order was affecting the 
   pages wp_query in admin. Bascially, we lost alphabetical with parent / child 
   reference, sorting. So before we updated to the latest plugin, our pages in admin
   would look like this:
 *     ```
       About Us
         - Contact Us
         - Locations
         - Social
   
       Our Food Menu
   
       Why Choose Us?
       ```
   
 * With the new version of PTO, the sorting goes something like this:
 *     ```
       Our Food Menu
   
       Why Choose Us?
   
       About Us
         - Contact Us
         - Locations
         - Social
       ```
   
 * I made a modification to the post-types-order.php around line 76 within the CPTOrderPosts()
   function and added:
 *     ```
       function CPTOrderPosts($orderBy, $query) {
   
           // ignore pages and retain original sorting
           if( $query->query['post_type'] == 'page' )
               return $orderBy;
   
           global $wpdb;
   
           $options          =     cpt_get_options();
   
       ....... rest of function
       ```
   
 * I think we need to add something in to totally disable the PTO functions if the
   current query is done in admin and is a pages query, since pages are hierarchical.
 * version 1.7.7 worked flawlessly
 * Thank you!
 * [https://wordpress.org/plugins/post-types-order/](https://wordpress.org/plugins/post-types-order/)

The topic ‘Issue with admin page sorting’ is closed to new replies.

 * ![](https://ps.w.org/post-types-order/assets/icon-128x128.png?rev=1226428)
 * [Post Types Order](https://wordpress.org/plugins/post-types-order/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/post-types-order/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/post-types-order/)
 * [Active Topics](https://wordpress.org/support/plugin/post-types-order/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/post-types-order/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/post-types-order/reviews/)

## Tags

 * [pages](https://wordpress.org/support/topic-tag/pages/)
 * [sorting](https://wordpress.org/support/topic-tag/sorting/)

 * 0 replies
 * 1 participant
 * Last reply from: [olie480](https://wordpress.org/support/users/olie480/)
 * Last activity: [10 years, 4 months ago](https://wordpress.org/support/topic/issue-with-admin-page-sorting/)
 * Status: not resolved