I have a rotating image carousel-type thingy on a wordpress blog that I load customized feature images into.
My problem is that I have this sucker repeating on every page above the post.
I really need it to load only on the homepage.
I've tried putting a is_home () tag in the code, but I really don't know where it is supposed to go!!
Here's the code... any help much appreciated.
Cheers
/* ------------ Rotating images top page ------------ */
function top_feature_box_rotator() {
echo ' <div class="adblock"><center>';
/*Rotating Ad number 1*/
$ads = array(array("title"=>"feature_box_1",
"img" =>"http://mysite.com/wp-content/themes/the ... image1.jpg",
"url" =>"http://www.url.com",),
/*Rotating Ad number 2*/
array("title"=>"feature_box_2",
"img" =>"http://mysite.com/wp-content/themes/the ... image2.jpg",
"url" =>"http://www.url.com",),
/*Rotating Ad number 3*/
array("title"=>"feature_box_3",
"img" =>"http://mysite.com/wp-content/themes/the ... image3.jpg",
"url" =>"http://www.url.com",)
);
shuffle($ads);
$ads = array($ads[0],$ads[1],$ads[2]);
foreach($ads as $ad){
?>
<a href="<?=$ad["url"]?>"><img src="<?=$ad["img"]?>" alt="<?=$ad["title"]?>" border="0"/></a>
<?
}
echo ' </div></center>';
}
add_action('thesis_hook_before_content', 'top_feature_box_rotator');