I am trying to add an image rotator to my wordpress but it will not show up.Is there a way to do this here is the code <script type="text/javascript"> <!-- Begin rnd.today=new Date(); rnd.seed=rnd.today.getTime(); function rnd() { rnd.seed = (rnd.seed*9301+49297) % 233280; return rnd.seed/(233280.0); }; function rand(number) { var result = Math.ceil(rnd()*number); if (!result)result++; return result }; var ad_cnt1 = 3; var ad1 = rand(ad_cnt1); var link1; var adBanner1; var width1 var height1 if (ad1==1) { link1="google.ca"; adBanner1="http://yazah.com/imagerotator/images/image1.jpg"; width1="400"; height1="400"; alt1=""; } if (ad1==2) { link1="google.ca"; adBanner1="http://yazah.com/imagerotator/images/image2.jpg"; width1="400"; height1="400"; alt1=""; } if (ad1==3) { link1="google.ca"; adBanner1="http://yazah.com/imagerotator/images/image3.jpg"; width1="400"; height1="400"; alt1=""; } document.write('<center><img src="' + adBanner1 + '" width=' + width1 + ' height=' + height1 + ' border=0 alt="' + alt1 + '">'); document.write('</center>'); // End --> </SCRIPT>
Why not use a wordpress banner plugin?... Regardless, do you have the images in the proper place because I set it up as an html file and am getting no images from your domain. http://clientdemos.info/dp_yazah/test_banner.html
<script type="text/javascript"> <!-- Begin rnd.today=new Date(); rnd.seed=rnd.today.getTime(); function rnd() { rnd.seed = (rnd.seed*9301+49297) % 233280; return rnd.seed/(233280.0); }; function rand(number) { var result = Math.ceil(rnd()*number); if (!result)result++; return result }; var ad_cnt1 = 3; var ad1 = rand(ad_cnt1); var link1; var adBanner1; var width1 var height1 if (ad1==1) { link1="google.ca"; adBanner1="http://yazah.com/imagerotator/1.jpg"; width1="400"; height1="400"; alt1=""; } if (ad1==2) { link1="google.ca"; adBanner1="http://yazah.com/imagerotator/2.JPG"; width1="400"; height1="400"; alt1=""; } if (ad1==3) { link1="google.ca"; adBanner1="http://yazah.com/imagerotator/3.jpg"; width1="400"; height1="400"; alt1=""; } document.write('<center><img src="' + adBanner1 + '" width=' + width1 + ' height=' + height1 + ' border=0 alt="' + alt1 + '">'); document.write('</center>'); // End --> </SCRIPT> try that.thanks
well that works - so if the ads are coming in then there is no reason why it won't work on your wordpress theme... You have to add the code to one of the files via > Appearance > Editor Select whichever file you are looking to add it to... Keep in mind the size of the image... Cheers!~
It works on your page but when i make a page in my wp admin and place that code in the content it shows nothing.