jQuery(document).ready(function(){ //change these let urlToRedirectTo = '/2024-programme/'; //REDIRECT PAGE let secondsUntilRefresh = 5; let imageUrlBase = '/wp-content/uploads/2024/06/Image_'; //URL of image just before the number let imageUrlExtension = '.jpg'; //image extension let imageMinNo = 1; let imageMaxNo = 3; let imageId = 'advert-image'; //This needs to go on the image e.g. //ignore these let imageElement = jQuery("#"+imageId); //grabs the element let randomImageNumber = Math.floor(Math.random() * (imageMaxNo - imageMinNo + 1) + imageMinNo); //works out random no let randomImageFullUrl = imageUrlBase + randomImageNumber + imageUrlExtension; //puts together image if(imageElement.length){ //checks if image exists? imageElement.attr("src",randomImageFullUrl); //sets URL } //handles redirect setTimeout(function(){ window.location.replace(urlToRedirectTo); }, (secondsUntilRefresh * 1000)); })

Page loading…
Thanks to our supporters. If the page does not refresh in five seconds, tap here to proceed.