Home › Forums › ACF PRO › Displaying users (relationship field) results in "array" in post › Reply To: Displaying users (relationship field) results in "array" in post
Hello Nessler,
The user field allows you to choose three options to return data.
With the first being the default. You have a few options here to get the data you want.
Since this is an array, you can do a little digging and use something like this in your template to find the exact fields you want to display:
<?php var_dump( get_field('coauteurs') ); ?>
Then once you pick the fields you want, you can do something like this:
<?php
// Get the user
$user_data = get_field('coauteurs');
echo $user_dzata['display_name'];
?>
Hope this helps.
Jeff
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.