Support

Account

Home Forums ACF PRO Display User Data with MultiSite Reply To: Display User Data with MultiSite

  • There are 2 choices.

    The first one is to not use the have_rows loop. You already have all of the data from the repeater, it an array, you just need to loop through it differently, see below. The second one is to not do restore_current_blog(); until after you’re done with the loop.

    
    <?php 
      switch_to_blog(1); 
      $jobs_list = get_field('job_titles', 'user_' . $user_db .'');
      // show me what's in $job_list
      echo '<pre>'; print_r($jobs_list); echo '</pre>';
      php restore_current_blog();
    ?>
    

    you can get the number of rows like this

    
    $num_rows = count($jobs_list);
    

    you can loop through them like this

    
    foreach ($jobs_list as $row) {
      echo <span>'. $row['job_title'] .'</span>'
    }