Title: [Plugin: Posts 2 Posts] Ordering connected posts
Last modified: August 19, 2016

---

# [Plugin: Posts 2 Posts] Ordering connected posts

 *  Resolved [JsonB123](https://wordpress.org/support/users/jsonb123/)
 * (@jsonb123)
 * [15 years, 1 month ago](https://wordpress.org/support/topic/plugin-posts-2-posts-ordering-connected-posts/)
 * Is ordering at all possible via the orderby and order parameters? If so, where
   do these go, under filters?
 * I was assuming that at least the order I connected the posts to a post would 
   stay, but upon reloading the page, it wasn’t so. Not sure what order they are
   behaving by either; it’s not alphabetical nor is it by post ID.
 * Also, just wanted to note how much I LOVE this plugin. Well done Scribu! Quality
   work as always.
 * [http://wordpress.org/extend/plugins/posts-to-posts/](http://wordpress.org/extend/plugins/posts-to-posts/)

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

 *  Plugin Author [scribu](https://wordpress.org/support/users/scribu/)
 * (@scribu)
 * [15 years, 1 month ago](https://wordpress.org/support/topic/plugin-posts-2-posts-ordering-connected-posts/#post-2015765)
 * Thanks for the kind words, but I can’t take all the credit for this release. 
   🙂
 * On the front-end, you can order them like so:
 *     ```
       $connected = get_posts( array(
         'suppress_filters' => false,
         'connected' => $post->ID,
         'post_type' => 'foo',
   
         'orderby' => 'title',
         'order' => 'asc'
       ) );
       ```
   
 * If you need explicit ordering, a potential solution would be to define an ‘order’
   field, which you then populate manually (like ye olde menu_order for pages).
 * Then, you would have to do some SQL hacking to make use of that custom ‘order’
   field.
 *  [Dave James Miller](https://wordpress.org/support/users/davejamesmiller/)
 * (@davejamesmiller)
 * [15 years, 1 month ago](https://wordpress.org/support/topic/plugin-posts-2-posts-ordering-connected-posts/#post-2015868)
 * I was just wondering something similar – ideally I’m looking for some way to 
   drag-drop the connected posts into order in the admin, then retrieve them in 
   that order every time.
 * I also wanted to say thanks for this plugin – it was very useful in a recent 
   project of mine.
 *  [non_human](https://wordpress.org/support/users/non_human/)
 * (@non_human)
 * [15 years ago](https://wordpress.org/support/topic/plugin-posts-2-posts-ordering-connected-posts/#post-2016007)
 * >  Then, you would have to do some SQL hacking to make use of that custom ‘order’
   > field.
 * Scribu, can you help with the example of that, please?
    If there’s p2p meta_key
   = “order” and values “1”, “2”..etc. how would you connect posts with p2pmeta 
   table? custom SQL query with inner join?
 *  Plugin Author [scribu](https://wordpress.org/support/users/scribu/)
 * (@scribu)
 * [14 years, 8 months ago](https://wordpress.org/support/topic/plugin-posts-2-posts-ordering-connected-posts/#post-2016053)
 * [@non_human](https://wordpress.org/support/users/non_human/): There’s now an 
   API for that:
 * [https://github.com/scribu/wp-posts-to-posts/wiki/Connection-ordering](https://github.com/scribu/wp-posts-to-posts/wiki/Connection-ordering)
 * > ideally I’m looking for some way to drag-drop the connected posts into order
   > in the admin, then retrieve them in that order every time.
 * The [development version](http://downloads.wordpress.org/plugin/posts-to-posts.zip)(
   0.9-alpha2) has the drag-and-drop part.

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

The topic ‘[Plugin: Posts 2 Posts] Ordering connected posts’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/posts-to-posts_7a8e9d.svg)
 * [Posts 2 Posts](https://wordpress.org/plugins/posts-to-posts/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/posts-to-posts/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/posts-to-posts/)
 * [Active Topics](https://wordpress.org/support/plugin/posts-to-posts/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/posts-to-posts/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/posts-to-posts/reviews/)

 * 4 replies
 * 4 participants
 * Last reply from: [scribu](https://wordpress.org/support/users/scribu/)
 * Last activity: [14 years, 8 months ago](https://wordpress.org/support/topic/plugin-posts-2-posts-ordering-connected-posts/#post-2016053)
 * Status: resolved