Home › Forums › Add-ons › Repeater Field › Displaying Data from 'User' Field Type › Reply To: Displaying Data from 'User' Field Type
I’m having trouble with a similar issue. What I want is for the editor on the WP backend to be able to pick a user, and have only their avatar show up on a certain part of the page. The user picker is inside of a repeater field. So like every other field I use the code <?php the_sub_field(‘expert_1’); ?> to display it in my page, with ‘expert_1’ being the field variable name of the user. However, of course, this gives me an array of data, not just the avatar, and the life of me I cannot figure out how to use the array. When I do gettype() on the_sub_field(‘expert_1’), I get NULL, when I feel like I should be getting array. I tried the_sub_field(‘expert_1’)[10] and that didn’t work. The little documentation out there on the user field hasn’t been helpful. Thanks for the help!
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.