treehouse : what would you like to learn today?
Web Design Web Development iOS Development

[Solved] Need an Image Rotator that uses all images in a folder...

  • I'm looking for an image rotator (i.e. Nivo slider or jQuery Cycle) that will pull images from a folder rather then having to specify each image link in html. An option for "random" would be nice too.

    If anyone knows of one let me know.

    Thank you,
    Charlie
  • Not exactly what your looking for, but I am sure it can be customized to your liking. Maybe using something like wp_get_attachment_image_src to replace 'example.jpg' . This is just merely a guess on my part.

    <?php
    $images = array(
    'example.jpg',
    'example.jpg',
    );
    $image = $images[array_rand($images)];
    $output = "<img src=\"source of image/" . $image . "\" />";
    echo $output;
    ?>
    <?php } ?>