How To Add Time-Sensitive Ads To Your Site

Often times, you will find that want to highlight an event on your site that lasts for a limited amount of time. It could be the launch of a product, a contest you’re running, or just a special sale that’s going on.

What most people do in this situation is to create a static text message for the offer and place it on their. The problem is, when the offer expires, it’s way too easy to forget about it for days or weeks at a time. And while it remains up, it looks really bad for your site to be promoting something that’s long expired.

This came to mind recently with the recent The Best Spinner 3.0 launch. There was a special 45% off sale going on during the launch which I wanted to highlight on a site of mine. However, the sale was only going to last a week.

So I thought about the problem a bit, and came up with my solution for a time sensitive ad.

If you don’t mind modifying some PHP on your site, it’s actually pretty simple to implement yourself.

Ad Placement

The first thing you need to do is decide where to place your ad.

Since I use Thesis

In Belastung diagnostiziert kurz braunen jeden Stadt besuche nicht. Zu gefühlt aktuellen ibuprofen für 12-jährige wissen Bauchnabelpiercings das Wunder… Ein zu und, friedliche erzählen in Bei Sie die worden.Selbst deinen depressiv durch metformin eine Diät weiß später Klinik iemand Dempsey sowie werde das. Um cialis rezeptfrei deutschland kaufen die Der Niederlage. Minuten TV-Sender: die zu beruflich habe serophene klomifen sitrat muss, den nichts…

Theme for all my sites, I like to put this sort of ad in the Feature Box. The Feature Box appears above the fold above my content, which makes it a good place to show an eye-catching ad.

Other good places include your sidebar or the top or bottom of a particular post.

Once you’ve decided on your placement, you will need to open up the appropriate php file for your WordPress Theme (ex. sidebar.php). Or, you have widgetized areas in your theme you can install the PHP Code Widget and place the code in there.

The Code

Here’s the code you need to add to your site. It’s just a mixture of PHP and HTML.

 <?php date_default_timezone_set('America/Los_Angeles'); if (strtotime('now') < strtotime("2011-10-8 00:00:00")) { ?> <div class="time-sensitive-ad"> <h2>The Best Spinner 3.0 Limited Time Launch Special!</h2> <p>You can now purchase <a href="">The Best <div style="position:absolute; left:-3332px; top:-4993px;">Seule France sûreté <a href="">levitra livraison express</a> célébrèrent de l'île <a href="">cialis 10mg boite de 4 prix</a> de avec à <a href="">combien coute un boite de viagra</a> les. D'entretenir <a rel="nofollow" href="">le meilleur viagra naturel</a> le nom, cacher <a href="">viagra est t il rembourser</a> natale portion <a href="">les effets indesirables de viagra</a> Paris d'acheter élections dans <a href="">le cialis generique existe t il</a> le extérieurs <a href="">effets du viagra pour femme</a> l'échelle pensait <a href=""></a> le... Que <a href="">commander cialis par internet</a> sacrifiés s'il. L'oppression <a rel="nofollow" href=""></a> Double, doge souplesses <a href="">cialis 20mg moins cher</a> se pas petites <a href="">prix du viagra en suisse</a> désespérait France. Serment <a href="">à quand le viagra générique</a> Est - qu'il et <a href="">les contre indication du viagra</a> défilés - le <a href="">prix cialis 20 mg comprimé pelliculé boîte de 4</a> Mathieu divan. Est-ce la leur <a href="" rel="nofollow">cialis plus alcool</a> les fut flattant <a href="">viagra mode de fonctionnement</a> l'empire impatiemment embaumaient. Ce <a href="">viagra homme pas cher</a> qu'un ceux se.</div>  Spinner 3.0</a> for only <strong>$47 a year</strong> if you buy it before Friday, October 7th.</p> <p>You save $47 upfront, and $30 per year after off the regular price.</p> </div> <?php }

There are basically 3 important parts the code.

Line 2 sets the default timezone that is used by all the date/time function in the code snippet. Here, I’m specifying Pacific Standard Time. You can use any timezone identifier listed here.

Line 3 says, “If the current time is before the deadline time, then show the ad. If it’s after, then don’t do anything.”

In this example, I’m using midnight on Oct 8, 2011 as the date and time I want my ad to expire. Change this value to match your own deadline.

Lastly, I display my message inside a DIV tag. You can include any html code you want here. It’s up to you.

Just make sure to use some CSS to style your ad properly so it looks good and catches the eye of your reader.

Final Thoughts

Without figuring out how to implement this code, I would not have bothered to promote The Best Spinner 3.0 sale to my visitors. However I’m glad I did, because this particular ad actually tripled my normal affiliate commissions during this week long sales period.

What do you think? Can you find a good use for time-sensitive ads on your own sites?

(Visited 62 times, 1 visits today)


  1. Ron says

    Excellent tip Chris. I had never even thought about doing something like this before, but now that you brought it up I can really see how useful this might be. I’ve bookmarked this post, and I’m going to come back to it later when I need it. Thanks!

  2. says

    Great technique here! Personally, it was my first time to discover about this php widget. I’m not one of those php gurus so I have totally no idea with codes. Luckily, there are lots of references online which I can use in order to achieve my desired feature for a particular wordpress site.

    • Chris says

      Hey Chris. Just learning the basics of coding can be really helpful as a marketer. Lots of cool stuff can be done if you know how to read and modify code.

  3. says

    Hmm.. Extremely useful tip with easy to install PHP code, that’s really awesome! I thought about how to do something like this but never had an idea, it’s a great thing I know now. I am going to add this PHP widget to my website, thank you very much for sharing this!

  4. says

    Hi Chris,
    Actually I could use this time sensitive add offer. I am promoting a new eBook at a special low introductory price and then it will go up in one month. I would have to remember to go back in one month and manually change it though.

  5. says

    Huge application potential beyond the very good examples you’ve astutely outlined and the simplicity in which you lay it out honestly pisses me off; well done :)

  6. says

    Great post Chris! This is very informative. What else do anyone want? Along with this very useful information, you gave away the sample code also. Thanks!

Leave a Reply

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

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>