Updated: How To Create a Random Banner Ad

Chloé Watts is the Founder of chloédigital and a Fashion Technologist.

I have got a fun tutorial for you to try this weekend on your blog! A while ago I did a tutorial on creating a header ad banner and judging from my Google Analytics it was very popular so I thought I’d turn it up a notch and making an updated version which changes on refresh! On the desktop version of this blog, TheFashionTechnologist you will see ad banner at the top of the page, if you refresh the page you will see another ad. I have three in a rotation, a Missguided, Topshop and Net-a-porter one.


If you would like your banner ad to change on refresh like this, add the following code to your theme (WordPress Only) functions file or if you are cool, to your custom functions plugin.



Then replace all the PASTE AD HERE with ad’s. If you use an affiliate network like rewardStyle then paste in the banner code in this space.


This random ad banner function has three ad’s in it, to add another simply paste in another:



When happy, open up the file where you would like your ad banner to show, for example to place it at the top of your blog then open header.php and just below the tag paste in the following (if you are struggling with where to paste it, see this tutorial!):


(uses inline styling)



That’s it! Pretty straight forward once you know how huh?

chloe-signature

Stay Updated

If you enjoyed this post, subscribe to the Fashion Technologist for updates

What are you interested in?

Discover more:
email course
Screen Shot 2014-06-10 at 17.43.10
two ways to make your site more secure
(feat) theFEED Profiles- RooftopAntics.com
How to change the default media linking option in wordpress
Why I do not like blog posts being By Admin
how to create a wordpress plugin
Broken Links

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 class="" title="" data-url=""> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre class="" title="" data-url=""> <span class="" title="" data-url="">