Home › Forums › Front-end Issues › Repeated Relationship Fields and $post › Reply To: Repeated Relationship Fields and $post
Hi @Will
If $internals
is an array of posts, then the get_sub_field function is working correctly. Perhaps the issue lies in the setup_postdata funciton which can cause many problems wiht the global $post object.
Try this instead:
$internals = get_sub_field('internal_link');
foreach($internals as $p): ?>
<a href="<?php echo get_permalink( $p->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.