Home › Forums › ACF PRO › Display multiple selected users NOT WORKING!. › Reply To: Display multiple selected users NOT WORKING!.
I use this code Did not edit anything, because the field uses the same name.
<?php
$users = get_field("volunteers");
if( $users ): ?>
<ul class="volunteers-list">
<?php foreach( $users as $user ): ?>
<li>
<img src="<?php echo esc_attr( get_avatar($user->ID) ); ?>" alt="author-avatar" />
<a href="<?php echo esc_attr($user->user_url); ?>"><?php echo $user->display_name; ?></a>
</li>
<?php endforeach; ?>
</ul>
<?php endif; ?>
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.