Title: [Plugin: Posts 2 Posts] Edits args for get_connected()
Last modified: August 20, 2016

---

# [Plugin: Posts 2 Posts] Edits args for get_connected()

 *  Resolved [David Gard](https://wordpress.org/support/users/duck_boy/)
 * (@duck_boy)
 * [14 years ago](https://wordpress.org/support/topic/plugin-posts-2-posts-edits-args-for-get_connected/)
 * I’m using the Posts 2 Posts plugin, which seems perfect for most of what I want
   to do, but there are a couple of features that I cannot work out through reading
   the documentation, so I wonder if someone could help?
 * Firstly, I need to show connections in the ‘to’ direction in one instance –
 * `$children = p2p_type('service_parents_and_children')->set_direction('to')->get_connected(
   get_queried_object_id());`
 * This works, but with the default WP args being passed (5 posts, date order, etc)–
   is there a way to pass my own custom args so that I can get the posts displaying
   as I require?
 * Also, I’m looking for a way of showing a posts ‘siblings’, I.e posts that have
   the same ‘from’ connection to a certain post (I have the ID of the post). I’ve
   explored `get_related()`, but I can’t seem to get it to do what I want.
 * This is a great plugin, so I’m fairly confident that these tasks can be acheived,
   so any help is greatly appriciated.
 * Thanks

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

 *  [scribu](https://wordpress.org/support/users/scribu/)
 * (@scribu)
 * [13 years, 10 months ago](https://wordpress.org/support/topic/plugin-posts-2-posts-edits-args-for-get_connected/#post-2681854)
 * I didn’t notice this thread because it doesn’t show up in the plugin forum.
 * > is there a way to pass my own custom args so that I can get the posts displaying
   > as I require?
 * Yes, there is:
 *     ```
       $children = p2p_type('service_parents_and_children')
         ->set_direction('to')
         ->get_connected( get_queried_object_id(), array( 'additional' => 'query_var' ) );
       ```
   
 * Or, more readable:
 *     ```
       $children = new WP_Query( array(
         'connected_type' => 'service_parents_and_children',
         'connected_direction' => 'to',
         'connected_items' => get_queried_object_id(),
         'additional' => 'query_var'
       ) );
       ```
   
 * As for get_related(), please open a new topic:
 * [http://wordpress.org/support/plugin/posts-to-posts](http://wordpress.org/support/plugin/posts-to-posts)
 *  Thread Starter [David Gard](https://wordpress.org/support/users/duck_boy/)
 * (@duck_boy)
 * [13 years, 10 months ago](https://wordpress.org/support/topic/plugin-posts-2-posts-edits-args-for-get_connected/#post-2681866)
 * Many thanks for getting back to me, I’ll give that a try shortly as I don’t think
   I ever got working quite as I wanted.
 * Thanks.

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

The topic ‘[Plugin: Posts 2 Posts] Edits args for get_connected()’ is closed to 
new replies.

## Tags

 * [posts-2-posts](https://wordpress.org/support/topic-tag/posts-2-posts/)

 * 2 replies
 * 2 participants
 * Last reply from: [David Gard](https://wordpress.org/support/users/duck_boy/)
 * Last activity: [13 years, 10 months ago](https://wordpress.org/support/topic/plugin-posts-2-posts-edits-args-for-get_connected/#post-2681866)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
