Hey again, I am trying to display connected users on a single elementor template. The author selects the sometimes multiple users to show using the user custom field. I want to create a loop to display the connected users.
Only problem is I don't know how to approach this or even which data to populate the loop with. I want to show the selected users name, photo and a custom field that is saved to their profile.
Do I need a shortcode for this? If so, how do I make one?
add_shortcode( 'display_coauthors', function() {
$post_id = get_post_field( 'post_id', get_queried_object_id() );
$co_author = rwmb_the_value( 'academicuser_contributor', ['object_type' => 'user'], ['display_field' => 'custom_avatar'] ); //academicusercontributor is the custom field id .. do I need to use the user fields id instead??
$output = $co_author;
return $output;
});