how show adsense.php randomly
-
hi.i use these codes for showing static ads in my website between posts.
<?php $count=count+1; ?>
<?php
$postnum = 1;
$showadsense1 = 2;
$showadsense2 = 4;
$showadsense3 = 4;
?>
<?php if (have_posts()) : ?>
<?php while (have_posts()) : the_post(); $loopcounter++; ?><?php if ($postnum == $showadsense1) { include (TEMPLATEPATH . ‘/adsense1.php’); } ?>
<?php if ($postnum == $showadsense2) { include (TEMPLATEPATH . ‘/adsense2.php’); } ?>
<?php if ($postnum == $showadsense3) { include (TEMPLATEPATH . ‘/adsense3.php’); } ?>
<?php $postnum++; ?>
<?php if ($loopcounter <= 0) { include (TEMPLATEPATH . ‘/adsense3.php’); } ?>
<?php endwhile; ?>
<?php else : ?>
<?php endif; ?>but i want use them randomly. for example one time show adsense1.php between 1-2 posts and another time show adsense2.php beteen them.
tnx
- The topic ‘how show adsense.php randomly’ is closed to new replies.