Hi everyone, I'm having a little problem. I've got a little PHP code rotating some Ads in my sidebar: <?php $random_number = rand(1, 4); $random_banner[1] = 'banner 1 code'; $random_banner[2] = 'banner 2 code'; $random_banner[3] = 'banner 3 code'; $random_banner[4] = 'banner 4 code'; echo "$random_banner[$random_number]"; ?> PHP: Only problem is the Ads are only showing on the Index page. When I visit pages or posts it disappears. This also happens if I change from PHP to a JavaScript equivalent. Is this a common issue I'm missing out on? You can see the problem in action at my site: http://wp.christianbullock.com/ (The Ad below the "About me" block). Thanks
It looks like this is a path problem for the images. This is your hompage (working) http://wp.christianbullock.com/wp-content/themes/letterpress/images/vh4.gif This is on one of your pages (not working) http://wp.christianbullock.com/category/freebies/wp-content/themes/letterpress/images/3d3.gif It looks like you are using relative URLs to the image so it is picking up where the visitor is currently at as part of the image URL.
If you are using any kind of plugin for displaying your ad then check it out its options as maybe there is an option like 'homepage only','all pages' etc. DON.
You were right . I tried being fancy and using a short image path to keep the file tidy, but as you pointed out the path to image changed when I left the index page. Got it sorted now, thanks for your help (+ rep) .