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.
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!
Are you building WordPress sites with ACF and @BeaverBuilder, and wanted to use your ACF Blocks in both the block editor and Beaver Builder?— Advanced Custom Fields (@wp_acf) May 10, 2023
The BB team recently added support for using ACF Blocks in Beaver Builder. Check it out 👇https://t.co/UalEIa5aQi
© 2023 Advanced Custom Fields.