-
$the_query = new WP_Query( $args ); if( $the_query->have_posts() ): while ( $the_query->have_posts() ) : $the_query->the_post();
$images = get_field('product_gallery');
if( $images ): foreach( $images as $key=>$image ):
if(!is_array($images[$key])){
$eric_id = $image;
$eric_urcs = wp_get_attachment_image_src($eric_id);
$eric_urc = $eric_urcs[0];
$image = array(
'id' => $eric_id,
'url' => $eric_urc,
'sizes' => array('thumbnail' => $eric_urc, )
);
$images[$key] = $image;
}
if (!$image['sizes']['thumbnail']) $image['sizes']['thumbnail'] = $srcs[0];
endforeach; endif;?>