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>'
}
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Privacy Policy. If you continue to use this site, you consent to our use of cookies.