WordPress.org

Forums

[resolved] Random Image from a separate directory? (7 posts)

  1. mellojoe
    Member
    Posted 7 years ago #

    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?

  2. mellojoe
    Member
    Posted 7 years ago #

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

  3. mellojoe
    Member
    Posted 7 years ago #

    Anyone?

  4. mellojoe
    Member
    Posted 7 years ago #

    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.

  5. mellojoe
    Member
    Posted 7 years ago #

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

  6. michaelmcguk
    Member
    Posted 7 years ago #

    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.

  7. pathfinder
    Member
    Posted 7 years ago #

    Thanks mellojoe. This is perfect. I love it.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.