Time Delayed Blog Ads On Your Post

I like a clean blog layout. I’m pretty much anal about it. So naturally it would be hardpressed for me to start machine gunning my blog with ads like a lot of blogs out there. After all, as anyone who earned more than a buck from it would tell you that it’s about where you place it rather than how much is on in the first place.

I got the idea from Micheal who is also the creator of the awesome Bad Behavior spam filter. What he’s done and what I followed suit is to place the least amount of ads on our blog for a certain period of time. After that time, the ads will come out.

It’s good for those of us who don’t want a cluttered single post and always tend to refer people back to our old posts to read. Since I’ve been getting quite a few people that have asked me how I did it, I thought I might explain it in greater detail here. What you do is basically ad this to your single post template:

7) : ?>
"Insert ad code here"

*Note: To deal with the automatic smiley conversion, I put a space between “:” and “?”. Just remove the space if you copied the entire code from here.

Now, you can pretty much guess that I’m running WordPress for this, but on the upside this works for all blogs that run on PHP and it’s pretty flexible too.

One is that while my ads are set to come out on my single posts after 7 days, you can set it to come out whenever you want or even disappear after a set amount of days. All you have to do is edit the number “$days_since > 7” to whatever day you want. Altering the “>” to “<" will set it to days earlier than the set amount of days so whatever you put will only come out for those few days. The other thing here is that whatever you insert in between the code doesn't necessarily have to be ads, it can be anything you want. Other text, javascript...etc. The possibilities are only limited to your imgination. But in this case, I use it for my adsense and it works like a charm. You can see it in action on my blog if you compare any recent posts to posts later than 7 days.

So there you have it. I hope you can put it to good flexible use. Maybe even develop a WordPress plugin from it, who knows? If you do have any problems though. Let me know and we’ll see what we can do with it.

5 thoughts on “Time Delayed Blog Ads On Your Post

  1. No exactly a wordpress question but I can see you got the cocomment thingy working with my blog’s pop ups. Did you have to tweak anything?

  2. Not really no. I manually entered the permalink and the titles into the cocomment everytime I post a comment on your blog. Tedious, but worth it. 🙂

  3. For what? Cocomment’s inability to talk to Blogger’s comment popups? It’s not your fault. Nothing to be sorry about. As long as it works, I’m pretty much game for that. 🙂

  4. There’s a WordPress plugin that can do the same thing and much more. It’s called Who Sees Ads?. No, I’m not the plugin author or earning anything from this. I, myself, has just started to use it.

Leave a Reply

Your email address will not be published. Required fields are marked *