Hi there,
My goal: Display a list of the users who have been allocated as ‘interested’ in the event by the admin. Ideally with a profile photo, but not essential. Just a username is fine.
I have been trying to wrap my head around trying to display a list of user object details using beaver builder. See screenshots for my current set up.
The front end is completely blank. I have even tried displaying the users in a ‘post’ module. I have also tried the following shortcode:
[wpbb post:acf_relational type='user' name='interested' display_type='username' link='no']
This doesn’t display anything either. Am I missing something?
Thank you
add_shortcode( 'display_interested_members', function () {
$users = get_field("interested");
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;
} );
I have also tried via ‘snippets’ and creating my own shortcode. This didn’t work either.