OK. I am reading this ACF tutorials, but I am not getting into this.
I have 2 post types: Lists and Contacts.
Every List must be related to some Contact, and I use Relationship custom field type (list_supplier), which is limited to only one choice (or Contact).
All I have to do is to display link on Lists template as Title of Contact post which is now related with that List.
OK. I am close to solve this, but I have some problems with filter.
Here is the code I am using in my template:
<?php $contacts = get_field('list_supplier'); ?> <?php if( $contacts ): ?> <?php foreach( $contacts as $contact ): ?> <a href="<?php echo get_permalink( $contact->ID ); ?>" target="blank"><?php echo get_the_title( $contact->ID ); ?></a> <?php endforeach; ?> <?php endif; ?>
In one moment I make it work on front end, but there was some problem with filters. When I add some of these filters into functions.php, choices from custom field list_supplier disappear. When I remove filter list_supplier chioces are there, but they are not showing on front end.
I know that problem is in filter, but I dont know how to wrote it.