Support

Account

Home Forums Front-end Issues Accessing Relationship Field Values Within Relationship Reply To: Accessing Relationship Field Values Within Relationship

  • Have you tried just getting the “location” field when looping through the “Producers”?

    
    <h4>Transaction Contacts</h4>
    <?php
      $producers = get_field('transaction_contacts');
      if($producers):
    ?>
    <ul class="list-unstyled">
    <?php foreach( $producers as $p) : ?>
      <?php 
        $office_location = get_field('office_locations', $p->ID);
      ?>
      <li>
        <p><?php echo get_the_title($p->ID); ?></p>
        <?php foreach( $office_location as $o) : ?>
          <p><?php echo get_the_title($o->ID); ?></p>
        <?php endforeach; ?>
      </li>
    <?php endforeach; ?>
    </ul>
    <?php endif; ?>