Support » Plugins » Random Image from a separate directory?

  • Resolved mellojoe


    I have had my galleries already installed and working (Gallery) long before I started with WordPress. Now, I’d like to add a random image to my sidebar.

    All the “rotating” image code I have found uses relative path to the WordPress blog, and that doesn’t work for me. I can’t figure out how to have a random image using absolute path for the file directory.

    Blog is in but the images are all in

    How can I have a random image from a separate directory?

Viewing 6 replies - 1 through 6 (of 6 total)
  • `Wanted to include this:

    How can I have a random image from a separate directory? And have it include pictures from nested directories, if possible?

    Images are located in and then in sub-directories albums/racing, albums/pets, albums/movies, albums/music, etc.


    Since I use GALLERY as my photo-gallery, it has EXACTLY what I was looking for built into it.

    <?php include(''); ?>

    By simply calling this pre-made PHP file, it generates a random thumbnail from all the galleries and it tags it with the name, link, and gallery title.


    See an example here:
    Check at the bottom of the right-hand side menu.

    PS: I’ve updated the Image rotator, and it works fantastically. Its at the top of the sidebar now.


    I’m interested in doing almost the exact same thing 🙂

    Can you please help out with this, any pointers you have, how I should install the gallery and display a random thumbnail?

    Many thanks.

    Thanks mellojoe. This is perfect. I love it.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Random Image from a separate directory?’ is closed to new replies.