开发者 | dartiss |
---|---|
更新时间 | 2012年3月26日 23:41 |
捐献地址: | 去捐款 |
PHP版本: | 2.0 及以上 |
WordPress版本: | 3.3.1 |
google_ad_client
, google_ad_slot
, google_ad_width
and google_ad_height
.
To display your AdSense advert you will need to insert the following code, where appropriate, into your theme...
<?php artiss_adsense_insert( 'client=pub-0743991857092062&slot=5302103070&width=468&height=60' ); ?>
In the above example, I've used my credentials, but you will need to use the details that I suggested you note before, as supplied by AdSense.
The client=
is your publisher ID (i.e. google_ad_client
), slot=
is google_ad_slot
, width=
is the width of the advert (i.e. google_ad_width
) and height=
is the height of the advert (i.e. google_ad_height
).
Alternatively, if you wish to ensure that your code still works correctly, even if Simple AdSense Insert is switched off, you can use the following format of code...
<?php if ( function_exists( 'artiss_adsense_insert' ) ) artiss_adsense_insert( 'client=pub-0743991857092062&slot=5302103070&width=468&height=60 '); ?>
For help with this plugin, or simply to comment or get in touch, please read the appropriate section in "Other Notes" for details. This plugin, and all support, is supplied for free, but donations are always welcome.
simple-adsense-insert
folder to your wp-content/plugins/ directory.Ah, yes. Google changed the format of their AdSense code - if you're looking at some existing AdSense code and it doesn't look the same as my examples, then head back to the AdSense website and get it to create the code again.
It has been tested and been found valid from PHP 4 upwards. Please note, however, that the minimum for WordPress is now PHP 5.2.4. Even though this plugin supports a lower version, I am not coding specifically to achieve this - therefore this minimum may change in the future.