• Backstory

    So back in 2007 when I created https://heiseheise.com, I used Matt Mullenweg’s “image rotater” script to make very simple image that changed whenever the page was refreshed. First and only update to his script was back in 2003; obviously wordpress has changed quite a bit since then.

    When I started using the script, ANY sort of reload of the page – be it hitting F5 or hitting a new category link in the left sidebar…would cause a new image to be loaded.

    Problem
    However, sometime in the past couple years, it seems like wordpress created an update which requires the webpage to no longer do a “full” refresh when you’re just trying to go somewhere else on the site. Of course, this makes perfect sense!

    But it does mean that people going around my website no longer get a “fresh” random image. They only get one if they press F5 to force the whole page to reload.

    My setup
    I’ve currently got randimage.php at the top of the main index.php site, which looks like the best place for it to be, so that way it will appear for any kind of content (single post, all posts, page not found, etc). But it would seem index.php is the file that no longer reloads whenever you click around a site.

    Can anyone help me find a better place to put the script to load, so that it will refresh for any sort of site page load, no just F5-style refreshing?

  • The topic ‘Using Ma.tt's "random image" php script, can anyone help me with a tiny update?’ is closed to new replies.