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:
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.
< ? php if(function_exists('ad_unit_name')) :
adsense_deluxe_ads('my_ad_unit'); endif;? >
More details

No comments:
Post a Comment
Silakan tinggalkan komentar, saran, kritik, masukan, tanggapan ataupun umpatan yang berkaitan dengan postingan disini: