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’) 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!
© 2023 Advanced Custom Fields.