Home › Forums › Front-end Issues › Use post chosen via relationship field as permalink › Reply To: Use post chosen via relationship field as permalink
Hi @calanthis99
If you already have a link, then I will assume that you already have a loop to show the 2 latest performance posts.
All you need to do is get the selected post, then load it’s permalink. You can do this like so:
$selected = get_field('relationship_field_name');
$selected = array_pop($selected);
$permalink = get_permalink($selected->ID);
Thanks
E
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.