Something probably off with my loop, the code below is on my "entries.php" template page, it's outputting the title and description of each entry fine but the repeater fields just repeats the first set of images from entry 1 throughout the loop.
<?php
// Functions
$entries = $page->children;
$entry_array = array();
$image_array = array();
foreach ($entries as $entry) {
// Define the fields wanted
$title = $entry->title;
$description = $entry->entry_description;
$images = $entry->images;
foreach ($images as $image) {
$imageUrl = $image->url; // make a thumb version
$imageDescription = $image->description;
// Build array from repeater
$image_array[] = array(
'image_url' => $imageUrl,
'image_description' => $imageDescription,
);
}
$pageUrl = $entry->httpUrl;
// Build the array from the fields
$entry_array[] = array(
'title' => $title,
'description' => $description,
'images' => $image_array,
'page_url' => $pageUrl,
);
}
// Json encode the array
$entries = json_encode($entry_array, true);
// Dump the data
// echo $data;
?>