|
The Datafeedr Random Ads plugin is a free plugin which allows you to simply and easily
show random ads anywhere in your template files or using widgets. If you need support, please visit our
support forums.
Subscribe Below and Get Notified About Any Updates or New Plugins!
* Please Note: This is a SPAM-FREE site. Your name and email address will NEVER be sold or traded.
Introduction
Let's say you have 3 banner ads that you want to randomly appear in your header. One
ad is Google Adsense, one is an affiliate banner and one is an ad for your own site.
Just add the code snippet for each ad to a text file, separate each ad with the
pipe "|" symbol and add a function call to your template file. Now, a random ad will
be shown in your header.
You can also easily add ads to your sidebar using the built-in widget.
For a more detailed description, see 'How does it work'
or watch the video below.
The player will show in this paragraph
Installation Instructions
- Unpack the zip file you downloaded.
- Upload the /wp-content/ads/ directory to your /wp-content/ directory
- Upload the /wp-content/plugins/datafeedr-ads.php file to your /wp-content/plugins/ directory.
- Activate the plugin
- Create .txt files containing your ads separated by pipe "|" symbols.
- Add the function calls to your template files to show the ads.
How does it work?
This plugin allows you to show 1 or more ads in a specific part of your site. The ads rotate randomly and there is no limit to the number of ads that can be put into rotation.
For example...
Let's say we have a 468x60 ad spot we want to fill and we have 3 different 468x60 ads that we want to randomly show in that spot.
Those ads are:
- Google Adsense
- An affiliate banner
- A house ad
First, we need to create a .txt that will hold our ads. Here are the contents of a file named "ads_468x60.txt" which is saved here: /wp-content/ads/. Notice that each ad is separated with a pipe "|" symbol.
<script type="text/javascript"><!--
google_ad_client = "pub-1234567812345678";
google_ad_width = 468;
google_ad_height = 60;
google_ad_format = "468x60_as";
google_ad_type = "text";
google_color_border = "FFFFFF";
google_color_bg = "FFFFFF";
google_color_link = "FF0000";
google_color_text = "000000";
google_color_url = "000000";
//--></script>
<script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>
|
<a href="http://www.datafeedr.com?aid=123" title="Datafeedr.com">
<img src="http://www.datafeedr.com/affiliates/image.php?bid=18" border="0" alt="" width="468" height="60" />
</a>
|
<div style="width: 468px; height: 60px; overflow: hidden;">
<strong><a href="http://www.wordpress.org/">My Site</a></strong><br />
I really hope you like my site. I made it using WordPress!
</div>
Now that we have added our ads, we need to place a call to the ad function somewhere in our templates.
Here is how we would call the .txt file named "ads_468x60.txt" from within a template file:
<?php if (function_exists('dfrad')) { echo dfrad('ads_468x60'); } ?>
Now, when you reload the page, one of the following 3 ads will be displayed:
That's all there is to it. There is some sample code and ad files included
in the download package. If you need support, please visit our
support forums.
Changelog
2008-06-24
|