Home › Forums › General Issues › Relationship field returning ID, how to return the correct values. › Reply To: Relationship field returning ID, how to return the correct values.
first, sorry for not answering sooner but when you answer your own post it gets removed from the awaiting reply list.
Anyway
I think you were closer on you first attempt. The problem was that you were not supplying the correct post ID for get_the_title.
If you are returning an array of IDs from your relationship field then you should use $studiotitle = get_the_title($studio);
If you’re returning post object from acf then you should use $studiotitle = get_the_title($studio->ID);
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.