Support

Account

Home Forums General Issues User Field Type Issues Reply To: User Field Type Issues

  • Thanks so much for the help! I am getting close but one last question. With this snippet I am able to print the assigned users and display the fields. The only issue is for displaying it only shows one of the user biographies despite the print_r showing the two.

    <?php 
    
    $users = get_field('guests2');
    echo '<pre>'; print_r($users); echo '</pre>'; // Prints out assigned user data
    if ($users): ?>
    
      <?php foreach ($users as $user): ?>
    
        <?php setup_postdata($user); 
        $userID = $user['ID'];
        $profile_image = get_field('profile_image', 'user_'. $userID);
        $biography = get_field('biography', 'user_'. $userID); 
       ?>
    	 
         <?php echo $biography; ?> // Only displays first user data rather than all
    	
      <?php endforeach; ?>
    
    <?php wp_reset_postdata(); ?>
    
    <?php endif; ?>