Simple AdSense Insert provides a basic way of inserting AdSense adverts into your WordPress installation, whilst having full control of display and content.
If you've not done so already, create your AdSense advert. The code you are provided provides the parameters that are required by Simple AdSense Insert. The 4 pieces of information you require are the values in 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 simple_adsense_insert('pub-0743991857092062','5302103070','468','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 first parameter is your publisher ID (i.e. google_ad_client) The second parameter is the slot (i.e. google_ad_slot) The third parameter is the width of the advert (i.e. google_ad_width) The last parameter 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('simple_adsense_insert')) simple_adsense_insert('pub-0743991857092062','5302103070','468','60'); ?>
If you don't wish to pass the same details each time (or simply want a single place where some of the details, for example your publisher ID, to be held) then you can hard code these into the plugin. In the wp-content/plugins/simple-adsense-insert/ folder, edit the simple-adsense-insert.php file. You will find 4 lines of code within it, beginning with...
if ($ad_client=="") {$ad_client="";}
To hard code any of the parameters, simply add them into the end of the appropriate line. For example, if I wanted to add my publisher ID in, I would change the first of these lines to read...
if ($ad_client=="") {$ad_client="pub-0743991857092062";}
Then, if you don't pass a publisher ID, the one above will be used by default. However, beware of using this method as implementing any update to this plugin will wipeout any hard coding changes that you may have made.




