Loopers - relational field in custom post type

Hey Team,
I have two custom post types. Home Designs and Finished Projects. The general idea is the user should be able to see finished projects when they look at any Design page. I’d like to present up to three finished projects (feature image with a link back to the actual project).

Each design has a relational field where the I can choose one or more projects based off the design.

I have the design page built but I’m having a hard time building the looper that finds only the projects that have been assigned to the design. Ideally I want to loop through and present up to 3 projects on each design page.

The structure is:
Column -> Looper Provider (Query Builder -> Posts “Finished Project” filter: find the projects that were based on this design)
Div -> Looper Consumer
the dynamic content

Got a minute to have a look?

Hello Gregg,

Thanks for the very detailed post information. You can simply run a Looper Provider Dynamic Content {{dc:acf:post_field field="projects_based_on_this_design"}} and this will return all the finished projects assign to the current Home Design. Kindly check the demo I added in your layout. You may need to create your own layout based on the demo since I only use the prefab POST element.

  • See the screenshot in the secure note below

Cheers.

That’s brilliant @ruenel!
Thank you so much! Another lesson learned. Appreciate it/you.

Gregg

You are most welcome @lorax

@prakash_s,
One more question - it looks like the example you used came from a standard library of elements. Where would I look to find this again?

Hey Lorax,

You can always use the Post element:

Cheers.

1 Like