How to Display Ads Depends on the Length of Content ?


A few months ago, Liew CF - One of Malaysian pro-blogger write a post about trick for displaying advertisements depends on the length of content. Unfortunately, that trick only applied for Wordpress platform. That trick automatically determining the length of your content (based on words) and will display the advertisement if the requirements of the length is fulfilled.
Cosa Aranda, successful AdSense publisher from Indonesia also write the similar post about the trick. The difference, he is using characters rather than words. If both of those tricks compared each others, I think the last method has more accuracy and better than the first method.
Here’s the code that can implemented at your site:

<?php
= 100;
= ‘word’; // word or char
= get_the_content();
= preg_replace(’/s+/’, ‘ ‘, strip_tags());
if ( == ‘word’)
= ((count(explode(” “,)) + count(explode(”.r”,)))-1);
else if ( == ‘char’)
= strlen();
if (&gt;) { ?&gt;
//YOUR ADS CODE HERE
<?php }
?&gt;

variable used to determine the minimum limit for char or word. And variable used to determine which method will be used for calculation. There’s no special formula to determine the value of threshold. Just make some trial-and-error until you got the suitable result for you.

Put the codes inside the Wordpress loop (between “while” and “endwhile”) on your Post/Page Template.


Tags: , , , , , , , , , ,


Bloom in ADSENSE, AFFILIATE, SEO PAGERANK |
Friday, June 13th, 2008
Related Post:
Get Paid for Blogging
Getting More Paid Per Click Techniques
Adsense or Yahoo Publisher Network
What is Adsense?
Bidvertiser Affiliate

Leave message (spam will be banned) :

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <code> <em> <i> <strike> <strong>