<div class="index_cat_title"> <span><?php the_title(); ?> </span> </div> <ul class="index_cat_list"> <?php if (have_rows('images')) { while (have_rows('images')) { the_row(); echo "<li>"; $image = get_sub_field('image'); image_object($image); echo "</li>"; } } ?> </ul> <?php } } ?> </div><!-- end of #index_wrapper --> <!-- SLIDESHOW -->
<?php // CREATE EMPTY ARRAY $front_images = array(); // QUERY $the_query = new WP_Query("post_type=images"); if ($the_query->have_posts()) { while ($the_query->have_posts()) { $the_query->the_post(); if (have_rows('images')) { while (have_rows('images')) { the_row(); $image = get_sub_field('image'); // APPEND TO ARRAY $front_images[] = $image; } } } } // SHUFFLE ARRAY shuffle($front_images); // ECHO OUT IMAGES foreach ($front_images as $front_image) { image_object($front_image); } ?> </div><!-- end of #front_wrapper --> <?php get_footer();