Home › Forums › General Issues › Get ALL fields for ALL posts in one array › Reply To: Get ALL fields for ALL posts in one array
I know that, at the end of your code, in this loop, is where things seem to get doubled up:
foreach ($all_posts as $p):
$p->acf_fields = $all_acf_fields[$x];
array_push($all_posts, $p);
$x++;
endforeach;
If I comment that out, and print $all_posts or $all_acf_fields, it shows the right number of arrays, ie, one array for each post
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.