Home Forums General Issues Displaying multiple user object details in beaver builder


Displaying multiple user object details in beaver builder

  • 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 ): ?>
                		<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>
        		<?php endforeach; ?>
    	<?php endif; 
    } );

    I have also tried via ‘snippets’ and creating my own shortcode. This didn’t work either.

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.