Display Google Ad after the first post

August 7, 2008 · 484 Views · Filed Under WordPress · Comment 

I don’t use Adsense on this blog, but I do use it on other sites of mine. I can’t remember where I found this, but I did save the code and instructions.

1. Create a file named “google-ad.php” containing your Adsense code.
2. Upload the file in the directory with your other template files.
3. Open your home.php template file and change it to the following code:

<?php if (have_posts()) : ?>
<?php while (have_posts()) : the_post(); $loopcounter++; ?>
<?php if ($loopcounter <= 1) { include (TEMPLATEPATH . '/google-ad.php'); } ?>
<?php endwhile; ?>
<?php else : ?>
<?php endif; ?>

If the $loopcounter is less than or equal to 1, then it includes your google-ad.php which contains your Adsense code.

Wordpress Plugin - AdServe

June 17, 2008 · 103 Views · Filed Under WordPress · 1 Comment 

I was just looking in to a better way to deliver the banner that you see at the top of the page. I started my search at the WordPress plugin page. I found the plugin “AdServe”. It looked like it would do just what I wanted.

AdServe is the advertising server for WordPress. You could setup your banner campaigns using different sized banners, set available impressions and count resulting clicks! Optionally AdServe links ads to blog users so that one could check the campaign results within the Dashboard!

* Unlimited number of advertisers, banners and zones.
* Advertisers have web access to real-time reports for their specific campaign.
* Launch a new browser when user clicks an ad, making it simple for them to return to your site.

The installation was easy just like most of the Wordpress plugins. After you activate the plugin, you can manage ads by going to “Manage > Ads”. Imagine that! LOL

After you have an ad setup, you’ll need to setup an ad zone. This is done by adding code into your template. The code in the instructions didn’t work for me. After doing some searching, I’ve found that the code below actually works.

<?php AdServe("zone_name"); ?>

If you have a blog, this is an easy way to display banners with added features.

WordPress Version: 2.5.1
AdServe Version: 0.3