Title: Posts 2 Posts not returning connected posts
Last modified: August 21, 2016

---

# Posts 2 Posts not returning connected posts

 *  [marcusjwilson](https://wordpress.org/support/users/marcusjwilson/)
 * (@marcusjwilson)
 * [12 years, 11 months ago](https://wordpress.org/support/topic/posts-2-posts-not-returning-connected-posts/)
 * Hi! I’ve been happily using Posts 2 Posts for a few years, but I’m a now a bit
   stuck with a query that doesn’t return connected posts, when I know there are
   connections.
 * I have registered the connection in functions.php between two custom posts types:
 *     ```
       p2p_register_connection_type( array(
       	'name' => 'quotes_to_production',
       	'from' => 'toonspeak_quotes',
       	'to' => 'production',
       	'reciprocal' => true
       ) );
       ```
   
 * Then I’m using the following code to find and display connections (also using
   the Advanced Custom Fields plugin:
 *     ```
       <?php if ($slidepost = get_field("slideshow-post-{$i}")) {
   
           setup_postdata($slidepost); ?>
   
                   <div class="slide-title"><?php echo get_the_title( $slidepost->ID ); ?></div>
   
                   <?php if ( 'production' == get_post_type( $slidepost->ID ) ) { 
   
                       $quotequery = new WP_Query( array(
                           'connected_direction' => 'from',
                           'connected_type' => 'quotes_to_production',
                           'connected_items' => get_queried_object_id( )
                       ) );
   
                       if ( $quotequery->have_posts() ) {
                           while ( $quotequery->have_posts() ) : $quotequery->the_post(); ?>
                               <blockquote><?php the_excerpt() ?></blockquote>
                               <h4><?php the_title() ?></h4>
                           <?php endwhile;
                       }
   
                       wp_reset_query();
   
                   } ?>
   
       <?php } ?>
       ```
   
 * This should return reciprocal connections, but doesn’t.
 * If anyone could spot what we’re doing wrong in the code, I’d be eternally grateful!
 * Thanks
    Marcus
 * [http://wordpress.org/extend/plugins/posts-to-posts/](http://wordpress.org/extend/plugins/posts-to-posts/)

The topic ‘Posts 2 Posts not returning 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/)

## Tags

 * [ACF](https://wordpress.org/support/topic-tag/acf/)
 * [posts2posts](https://wordpress.org/support/topic-tag/posts2posts/)

 * 0 replies
 * 1 participant
 * Last reply from: [marcusjwilson](https://wordpress.org/support/users/marcusjwilson/)
 * Last activity: [12 years, 11 months ago](https://wordpress.org/support/topic/posts-2-posts-not-returning-connected-posts/)
 * Status: not resolved