I'm using Advanced Custom Fields on my website.
I have a repeater field called anime_par, with sub_field called animateur. Sub field animateur is a post-object.
I’m using this inside a loop in my page, a loop that displays posts from a category inside a custom post type.
What I’m trying to do is to display the post name and post link of the animateur selection inside my page.
Here is the code I’m using but it’s not working, it displays the permalink of my current page, not the one selected in the custom field.
<?php while(has_sub_field('anime_par')): ?>
<a href="<?php echo get_permalink('the_sub_field("animateur")'); ?>"><?php echo get_title('the_sub_field("animateur")'); ?></a>
<?php endwhile; ?>
Any suggestions to make this work?
thanks for your help,