Title: [Plugin: Posts 2 Posts] Nested related
Last modified: August 20, 2016

---

# [Plugin: Posts 2 Posts] Nested related

 *  Resolved [Carloalberto Fornea](https://wordpress.org/support/users/carletto0282/)
 * (@carletto0282)
 * [13 years, 8 months ago](https://wordpress.org/support/topic/plugin-posts-2-posts-nested-related/)
 * Hi there,
 * what if I’d like to retrieve related post from a related post to the actual?
 * The scenario is this:
 * I got a cpt named movies related to a cpt named producers
 * In a detail page of a movie I’d like to show “movies from the same producer” 
   that, as I stated above, is like to nest a related query (the one for the movies
   related to the producer) inside another one (the one that gives me the producer
   related to the movie I’m looking at).
 * The scheme could be:
 * -movie page
    – producer X – movie1 by producer X – movie2 by producer X – …
 * Thanks guys
    regards Carlo
 * [http://wordpress.org/extend/plugins/posts-to-posts/](http://wordpress.org/extend/plugins/posts-to-posts/)

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

 *  Plugin Author [scribu](https://wordpress.org/support/users/scribu/)
 * (@scribu)
 * [13 years, 8 months ago](https://wordpress.org/support/topic/plugin-posts-2-posts-nested-related/#post-3033068)
 * Just call `get_related()` for each producer.
 *  Thread Starter [Carloalberto Fornea](https://wordpress.org/support/users/carletto0282/)
 * (@carletto0282)
 * [13 years, 8 months ago](https://wordpress.org/support/topic/plugin-posts-2-posts-nested-related/#post-3033070)
 * Ok mate!
    Thanks
 *  Thread Starter [Carloalberto Fornea](https://wordpress.org/support/users/carletto0282/)
 * (@carletto0282)
 * [13 years, 8 months ago](https://wordpress.org/support/topic/plugin-posts-2-posts-nested-related/#post-3033083)
 * I call get_related for each producer but if there are movies produced by both
   producers I get them doubled per each producer…
 * Producer 1
    – movie 1 (produced only by prod1) – movie 2 (produced by both) –
   movie 2 …
 * Producer 2
    – movie 2 – movie 2 …
 * Any suggestion to avoid duplication?
    Thanks
 * Carlo

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

The topic ‘[Plugin: Posts 2 Posts] Nested related’ 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/)

 * 3 replies
 * 2 participants
 * Last reply from: [Carloalberto Fornea](https://wordpress.org/support/users/carletto0282/)
 * Last activity: [13 years, 8 months ago](https://wordpress.org/support/topic/plugin-posts-2-posts-nested-related/#post-3033083)
 * Status: resolved