Home › Forums › ACF PRO › Relationship field once removed (2nd cousin?) › Reply To: Relationship field once removed (2nd cousin?)
I’m going to assume that both of these relationship fields are “Post Object” and that you are returning the Post Object. Let me know if this is incorrect.
// code on the property page
// somewhere inside "The Loop"
// get the project object on from the property post
$project = get_field('project');
$product_id = $project->ID;
// get the agent object from the project post
$agent = get_field('agent', $project_id);
$agent_id = $agent_id;
// show the title of the agent post
echo get_the_title($agent_id);
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Privacy Policy. If you continue to use this site, you consent to our use of cookies.