Does anyone know of a plugin that would automatically insert ads into Wordpress posts? My goal is to add a left justified 300x250 ad after the first paragraph (or certain amount of characters) and another right justified 300x250 ad near the bottom if the post is long enough. I'm using a Mix of Google Adsense code and GAM code so a general plugin for ads would be better than an adsense specific one. Anyone know of something that does this? Thanks!
go to single.php delete the_content, or content. replace with this code: <?php $where = 1; $content = apply_filters('the_content', get_the_content()); $content = explode("</p>", $content); for ($i = 0; $i <count($content); $i++) { if ($i == $where) { ?> <div style="float:right; margin:0 0 10px 10px;"> Your ads here. </div> <?php } echo $content[$i] . "</p>"; } ?>
Did you ever try Caffeinated Content plugin. It does the job of not only pulling in content but also has ability to put in a link (adsense or any other link you want) automatically. -Rich