Title: Multiple Connection Groups?
Last modified: August 20, 2016

---

# Multiple Connection Groups?

 *  Resolved [Meace](https://wordpress.org/support/users/meace/)
 * (@meace)
 * [14 years, 9 months ago](https://wordpress.org/support/topic/multiple-connection-groups/)
 * Hi,
    Thanks for the great plugin! I was wondering if it is possible to store 
   multiple sets of connections values between the same type of posts.
 * Something like this:
 *     ```
       p2p_register_connection_type( array(
           'from' => 'post',
           'to' => 'post',
           'title' => 'Group A'
       ) );
   
       p2p_register_connection_type( array(
           'from' => 'post',
           'to' => 'post',
           'title' => 'Group B'
       ) );
       ```
   
 * And then loops through the groups separately in the single page template.
 * When I try that it adds a connection to both Group A and Group B instead of only
   the group it was added to initially.

Viewing 1 replies (of 1 total)

 *  Plugin Author [scribu](https://wordpress.org/support/users/scribu/)
 * (@scribu)
 * [14 years, 9 months ago](https://wordpress.org/support/topic/multiple-connection-groups/#post-2270295)
 * You can do this with the [development version](http://downloads.wordpress.org/plugin/posts-to-posts.zip)(
   0.8.1-alpha2):
 *     ```
       p2p_register_connection_type( array(
              ...
              'data' => array( 'type' => 'group_a' ),
       ) );
   
       p2p_register_connection_type( array(
              ...
              'data' => array( 'type' => 'group_b' ),
       ) );
       ```
   
 * Then, you would query connections for a certain group like so:
 *     ```
       $connected_in_group = get_posts( array(
              ...
             'connected_meta' => array( 'type' => 'group_a' )
       ) );
       ```
   

Viewing 1 replies (of 1 total)

The topic ‘Multiple Connection Groups?’ 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/)

 * 1 reply
 * 2 participants
 * Last reply from: [scribu](https://wordpress.org/support/users/scribu/)
 * Last activity: [14 years, 9 months ago](https://wordpress.org/support/topic/multiple-connection-groups/#post-2270295)
 * Status: resolved