• Resolved 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 https://jpdimaggio.com/news but the images are all in https://jpdimaggio.com/gallery/albums.

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

Viewing 6 replies - 1 through 6 (of 6 total)
  • Thread Starter 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.

    Thread Starter mellojoe

    (@mellojoe)

    Anyone?

    Thread Starter mellojoe

    (@mellojoe)

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

    <?php include('https://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.

    Thread Starter mellojoe

    (@mellojoe)

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

    michaelmcguk

    (@michaelmcguk)

    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.

    pathfinder

    (@pathfinder)

    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.