Creating AdSense Widgets in WordPress
Recently I attempted to create a WordPress widget for an AdSense Firefox referral image ad in a widget-ready theme. I was quite surprised how easy it was. It may not be the best code ever, but it got the job done. Here is a quick run-down of how I did it.
Assuming you already have the Google AdSense unit code, create a file like <root directory>/wp-content/themes/<specific theme>/widgets/ff_ad.php and put your unit code in it. You will probably have to create the widgets directory under your specific theme. So the AdSense code in ff_ad.php should look something like this:
Then in the <root directory>/wp-content/themes/<specific theme>/function.php, add this:
At this point, the widget should show up in the list of available widgets for the theme.
Thats it.