Support

Account

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; ?>