• Hey there,

    I’m wondering if there’s anyway to have your index.php load a random image into where the header is supposed to be. I don’t know php, but I have set the index.php file up so that it (not the CSS document) loads the image in. All I need is some code that tells the server to load a random image in there from a specified folder.

    Does anybody have any suggestions/can anybody whip this up?

    a€??Andrew

Viewing 6 replies - 1 through 6 (of 6 total)
  • Thread Starter Andrew

    (@andrew)

    I did searcha€??I guess I must have entered the wrong terms.

    Thanks, though.

    Hmm… can’t get this one to work. I’m following the instructions here: https://photomatt.net/scripts/randomimage

    I’m using this code, but it doesn’t work:

    < img src=”rotate.png” alt=”A Random Image”/ >
    (I put spaces in between the carots so that the code doesn’t actually do anything on the forum)

    I’ve got the rotate.png set correctly (I think). Weird.

    You should be linking to a rotate.php file, not an actual image.

    I believe in Matt’s version you have to edit the php file and enter the location of the pics you want rotated.

    I have one that just rotates whatever images happen to be in the same folder as the file.

    Thread Starter Andrew

    (@andrew)

    Yeah, when I said “rotate.png” I meant “rotate.php.” I have tried referring to the php file simply as another image, but I always get the little question mark icon, and the image doesn’t load. I’m certain I have the actually php file set right. Strange.

    I’ll gladly try your image rotatora€??all I need is something really simplea€??at best, a bit of code which I could drop within my <div> class that displays a random image within a folder would suit my needs perfectly.

    Hi, I sucessfully installed Matt’s rotator yesterday. (Photomatt)
    (Wp1.5 Strayhorn)

    What is strange is that it shows a new random picture only after a hard refresh (Ctrl + F5), With normal refresh or after changing pages, the picture is not rotated.

    Any idea anyone?

    andrew,

    make a directory with all the images you want to show in the header. than make sure rotate.php has the right path, than in your CSS file look for the header class and add this part background-image: url(‘rotate.php’);. just point the rotate.php to the right path where the file is located.

    you can view mine at https://www.fusionrain.com/blog everytime you refresh the browser a new pictures comes up.

    thanks
    solarpunk

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Image Rotator?’ is closed to new replies.