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 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.
1 2 3 4 5 6 7 8 9 10 11 12 | <?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="http://thebestspinner.com">The Best 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?




{ 14 comments… read them below or add one }
Love this tip Chris! I’ve always wondered how to do something like this and you’ve explained how to do it very simply. Thanks!
Kinley McFadden recently posted..My Worst First Date
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!
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 recently posted..Schwinn A20 Recumbent Bike Review
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.
I like how you explain this in non-techie talk. Of course the fact that you use Thesis helps. Thanks for sharing!
Ana recently posted..Aweber Review
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!
Amit recently posted..Get a Forklift License
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.
Justin | Personal Growth recently posted..Mazzastick.com’s Guide 4 New Bloggers eBook
very functional code, i’ve updated one of my blog with it yesterday and saw a clear change in the stats.
~Aansy Stone
Time sensitive ads are a great idea! thanks for sharing, Chris.
Pete Goumas recently posted..Tony Little Review
Hi Chris. Great tip. Gonna try this out on my site tomorrow.
Ellie
Ellie recently posted..Control Panic Attack
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 :)
W. R. Mineo recently posted..Safeco Insurance Overview : Liberty Mutual Insurance Safeco
Thanks for the tips, Chris. I’ve been wanting to create some time sensitive ads for awhile now.
Doug Gene recently posted..Outdoor Play Coupon Code Discount and Review
Interesting tips you got here, useful and easy to install PHP code. Time sensitive ads is a great idea, thanks for sharing this.how to repair motorcycle fairings
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!
jane recently posted..Classic Easter Bunny Gift Basket