Well hello ACF PRO community, here my situation goes,
I have 1 custom post type named “Contracts”
and 2 another custom post types named “Payment 1”, “Payment 2”
Contracts have a relationship field named “payment_contract”
Also payments have the same field named “payment_contract”,
“payment_contract” is bidirectional relationship field that I mentioned it in functions.php
One payment can only be related to one contract but a contract can have more than one payments
when I use it with only 1 payment type it works.
But when I try to use it with more than 1 payment type, only one of the payment type works.
I want to display related contract from the pages of payment 1 and payment 2, but only 1 works,
I am using the code given in documents
<?php $related_contract = get_field( 'payment_contract' ); ?>
<?php if ( $related_contract ) : ?>
<?php foreach ( $related_contract as $post ) : ?>
<?php setup_postdata ( $post ); ?>
---- contract details go here ---
<?php endforeach; ?>
<?php wp_reset_postdata(); ?>
<?php endif; ?>
it works on payment 1 and it returns blank in payment 2,
before I added payment type 2, payment 1 was working just fine.
I am wondering what can be wrong