Title: Nested ACF Relationship
Last modified: June 13, 2020

---

# Nested ACF Relationship

 *  [studioavanti](https://wordpress.org/support/users/studioavanti/)
 * (@studioavanti)
 * [5 years, 12 months ago](https://wordpress.org/support/topic/nested-acf-relationship/)
 * Hi,
 * In a CPT Archive, i try to fetch a field from related posts of a different CPT(
   set with ACF Relationship), which is also an ACF Relationship (related to a third
   CPT).
 * I use this:
 *     ```
       [related my_acf_relationship_to_2nd_cpt]
           [field my_acf_relationship_to_3rd_cpt], 
       [/related]
       ```
   
 * This works, kind of, by returning the final posts IDs.
    But i need to get these
   posts titles: it would require to nest another CCS [related], which doesn’t work…
 * I tried the out parameter with no luck:
 *     ```
           [field my_acf_relationship_to_3rd_cpt out=slug], 
       ```
   
 * Any idea how to proceed please?
 * Sorry, it’s a bit tricky to explain.
    -  This topic was modified 5 years, 12 months ago by [studioavanti](https://wordpress.org/support/users/studioavanti/).
    -  This topic was modified 5 years, 12 months ago by [James Huff](https://wordpress.org/support/users/macmanx/).

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

 *  [polarracing](https://wordpress.org/support/users/polarracing/)
 * (@polarracing)
 * [5 years, 12 months ago](https://wordpress.org/support/topic/nested-acf-relationship/#post-12982685)
 * Have you tried to use a Metashortcode. So you could run one [relation] within
   you code – pass the id of the post to the metashortcode and get back the final
   title from there.
 * I never tried this for [related] but in other cases I was able to break some 
   limits I had using this method.
    -  This reply was modified 5 years, 12 months ago by [polarracing](https://wordpress.org/support/users/polarracing/).
    -  This reply was modified 5 years, 12 months ago by [polarracing](https://wordpress.org/support/users/polarracing/).
 *  Thread Starter [studioavanti](https://wordpress.org/support/users/studioavanti/)
 * (@studioavanti)
 * [5 years, 12 months ago](https://wordpress.org/support/topic/nested-acf-relationship/#post-12984222)
 * Thanks for your suggestion, it gave me the occasion to use this Meta shortcode
   i’ve never used before.
 * I tried a few things like nesting a second [related] in the meta shortcode or
   looping through the posts IDs fetch with [pass] inside the first [related], no
   luck so far.
 *  [polarracing](https://wordpress.org/support/users/polarracing/)
 * (@polarracing)
 * [5 years, 12 months ago](https://wordpress.org/support/topic/nested-acf-relationship/#post-12986310)
 * The [related] does not let you define the post you are searching in – just the
   field.
 * That said I would try following approach.
 * 1. In the current code I would run the [related] to get the ID of the first relation.
   
   2. Then pass this to the meta-shortcode and run a loop there to get the right
   post 3. Run related in the loop within the meta shortcode to return my result.
    -  This reply was modified 5 years, 12 months ago by [polarracing](https://wordpress.org/support/users/polarracing/).

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

The topic ‘Nested ACF Relationship’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/custom-content-shortcode_766976.svg)
 * [Custom Content Shortcode](https://wordpress.org/plugins/custom-content-shortcode/)
 * [Support Threads](https://wordpress.org/support/plugin/custom-content-shortcode/)
 * [Active Topics](https://wordpress.org/support/plugin/custom-content-shortcode/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/custom-content-shortcode/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/custom-content-shortcode/reviews/)

 * 3 replies
 * 2 participants
 * Last reply from: [polarracing](https://wordpress.org/support/users/polarracing/)
 * Last activity: [5 years, 12 months ago](https://wordpress.org/support/topic/nested-acf-relationship/#post-12986310)
 * Status: not resolved