Moose Candy might help…at least, it might be a starting point. 🙂
Try this. Just put it inside your loop where you want the AdSense to show up.
<?php $i++; if($i%3){ ?>
ADSENSE CODE HERE
<?php } ?>
Moose Candy was designed for exactly this purpose. You can set it up to put any kind of content you want virtually anywhere…after the first post, the fifth post, or any combination you want.
Hey, everyone —
Thanks for the suggestions… the php code Cine left me didn’t quite work… it seemed to want to post the google ad after each one of the first 3 posts. I tried changing
if($i%3)
to
if($i=3)
and got similar results.
NuclearMoose, I tried the MooseCandy plugin, but it didn’t display anything when I inserted Google’s javascript code. However, it worked perfectly with the example strings. Is there something I have to change to get moosecandy to work with code?
Strike that, sorry… it didn’t work with the example strings OR the code.
I have the random adsense placement code at:
http://ww.wp.xz.cn/support/topic.php?id=12685
Note: my site is not implementing it now.
In googlepagos.com you can view tools for AdSense…. The AdSense Calculator, Google Dance and Others
Cine’s code is correct, however, I believe variable “i” is already taken by wordpress. To correct Cine’s post, just change “i” to anything else… in the following example, I changed it to “adpostcount” and voila, it works!
<?php $adpostcount++; if($adpostcount==3){ echo ($adpostcount)?> put your code here <?php } ?>
^^^ The code above will work. Place it before <?php endwhile; ?> and change “3” to whichever number you want and change “put your code here” with your ad code.
Here’s my basic contribution to the community. Thanks again Cine!
Whoops, here’s the same code minus the echo 😛
<?php $adcount++; if($adcount==3){ ?> put your code here <?php } ?>
Now Googlepagos is TodoAds and is in http://www.todoads.com
wow cine’s code works wonders. glad i found it.
what file does this code actually go in?