Home › Forums › General Issues › Nested Relationship Fields › Reply To: Nested Relationship Fields
figured out the issue, i had to change the following code from…
<?php $posts = get_field('agent'); if( $posts ): ?>
<div class="agents">
<?php foreach( $posts as $p ): // variable must NOT be called $post (IMPORTANT) ?>
to this code….. basically $posts in this section to $agent
<?php $agent = get_field('agent'); if( $posts ): ?>
<div class="agents">
<?php foreach( $agent as $p ): // variable must NOT be called $post (IMPORTANT) ?>
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.