rotating banner images
-
Please see https://sprangleblog.com/
I want to rotate different images in the banner where there is now the TajMahal. I have prepared images to the same dimensions and put them in the same folder.
I’ve installed the Plugin “AdRotator” but I think it is not appropriate to what I want. It never mentions images or folders in the PHP code. It says only, “Rotates Ads randomly from a specified text file.”
However, maybe I’m being my usual picky-picky self who thinks that if someone says file they do not excpect me to understand folder and if the say text I should not assume image.
But, in blind faith I have created a folder called “banner_images” and installed it in the root. I’ve put two images in it.
So, assuming this is the right Plugin, how should I edit the AdRotator PHP to make this work?
QUOTE
*/
/* Usage: echo getad(‘Ad File Name’); */
function getad($ad = ”) {
$ad = trim($ad);
if(strlen($ad) > 0) {
$ad = ABSPATH . “wp-content/” . $ad . ‘.txt’;
if(file_exists($ad)) {
$ads = file($ad);
return $ads[rand(0, sizeof($ads)-1)];
}
}
}
?>END QUOTE
But if it’s not the right Plugin, I’d welcome suggestions.
TIA
- The topic ‘rotating banner images’ is closed to new replies.