27 September 2007

AdSense-Deluxe WordPress Plugin

AdSense-Deluxe is an easy-to-use plugin for WordPress 1.5+ (including WP 2.0) for quickly inserting Google or Yahoo! ads into your blog posts, and managing when and where those ads are displayed. It was developed for my own use after an exhaustive search for a similar tool turned up nothing adequate.

Have you added Google AdSense to your WordPress blog yet? Or maybe thought about it? I was thinking about this last year and knew I could do it generically in the templates, or painfully by pasting the AdSense code into each post I wanted it in, but neither seemed like the optimal way to accomplish my aims. I wanted some flexibility in deciding which posts ads appear in and perhaps some control of which ad format would display in any given blog post.

Usage:

You can wrap inline CSS styles around your AdSense blocks, or place any other html or strings around, before or after the AdSense JavaScript. For example:

< style="display:block;float:left;padding:5px;">

your google adsense code


To insert any of your defined ad units within template files, you can call a PHP plugin function with the name of the ad unit you want displayed. The syntax is as follows:

< ? php adsense_deluxe_ads('my_AdBlock_name');? >

However, it’s strongly recommended that you always confirm that the function is available to keep from generating PHP errors or breaking your page display, using the following syntax:

< ? php if(function_exists('ad_unit_name')) :
adsense_deluxe_ads('my_ad_unit'); endif;? >

When you use this new feature it enables the plugin to track the total number of AdSense units displayed on a page and avoid inserting more than the maximum of three units allowed by Google.
More details

No comments:

Post a Comment

Silakan tinggalkan komentar, saran, kritik, masukan, tanggapan ataupun umpatan yang berkaitan dengan postingan disini: