Hello people, I was wondering if any of you knew of any sort of script or code that would disallow more than three ads being placed on any page. The problem I have is that I'm using a wordpress blog and I like my ads to be at the top of each post however if I do that then I'll have 10 ads on the homepage. Any help or advice would be greatly appreciated. Thanks!
Thanks for the tip frisby. I've been all over wordpress and google trying to find something that does this and I can't find anything for the life of me.
Find what you want for advertising on your blog here. 1 minute of searching and I don't use WordPress. Bye.
Thanks again frisby. I saw that page before but the title of the plugin that is supposed to work 'MooseCandy' threw me off. MooseCandy Plugin doesn't work but there's a great page I stumbled upon that shows you how to control your adsense placement very easily. The Solution: http://www.tamba2.org.uk/wordpress/adsense/
There is a similar module for drupal users, but since you have the solution, i guess no need unless drupal does it better
// simple php function $adsense_count = 0; function adsense_show($codenum) { global $adsense_count; $adsense_codes = array("CODE 1","CODE 2","CODE 3"); if($adsense_count < 3){ echo $adsense_codes[$codenum]; } $adsense_count++; } Code (markup): using (content) <?php adsense_show(0); adsense_show(1); adsense_show(2); adsense_show(1); adsense_show(2); ?> Code (markup): it will only show 3 adsense ads
No, what Google does is leave a big honking white space where the ad should be (unless you're using the HTML file they provide to collapse the space). I use a similar approach to LucasMS but simpler: $postcount = 0; // WP code to display post goes here $postcount++; if ($postcount < 3) { ?><!-- AS code goes here --><?php } ?> Code (markup): No need for functions or arrays. Then again I don't need to use different codes for each post. :shrug:
It is automatic, and Google does do it for you, but you STILL CAN'T have more than 3 Adsense code blocks on a given page.
Yea, I tried the MooseCandy plugin several times and it didn't work. Maybe it's just because it's not compatible with the newest WP, or maybe I just really suck but it's such an easy solution even without a plugin. Thanks for all the help everyone!