WordPress.org

Support

Support » Plugins and Hacks » [Resolved] Random Image from a separate directory?

[Resolved] Random Image from a separate directory?

  • mellojoe

    @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.

    Example:
    Blog is in http://jpdimaggio.com/news but the images are all in http://jpdimaggio.com/gallery/albums.

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

Viewing 6 replies - 1 through 6 (of 6 total)
  • mellojoe

    @mellojoe

    `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?

    Example:
    Images are located in jpdimaggio.com/gallery/albums and then in sub-directories albums/racing, albums/pets, albums/movies, albums/music, etc.

    mellojoe

    @mellojoe

    Anyone?

    mellojoe

    @mellojoe

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

    <?php include('http://domain.com/gallery/block-random.php'); ?>

    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.

    PERFECT!

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

    mellojoe

    @mellojoe

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

    mellojoe,

    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 ‘[Resolved] Random Image from a separate directory?’ is closed to new replies.