Im trying to set up a page on my site that has all the images from the media library on it shuffled up in a random order.
As of now I have the strings in a really long array and was wondering how I could turn them into images and "shuffle" them or maybe query them in a random order first and then convert them?
Have been stuck on this for awhile so any tips would be good.
Here is a link to the site http://ownc.co.nz/random/
Cheers
<?php $query_images_args = array('post_type' => 'attachment', 'post_mime_type' => 'image', 'post_status' => 'inherit', 'posts_per_page' => -1, );
$query_images = new WP_Query($query_images_args);
$images = array();
foreach ($query_images->posts as $image) {
$images[] = wp_get_attachment_url($image -> ID);
}
var_dump($images);
?>