Bit by bit the site is getting customized and I learn something new every day. Today’s lesson was, “programming language updates may affect your website even if you know nothing about programming.” Obvious, huh? Try fixing the problem if you don’t program. Try even figuring what questions to ask.
The lastest addition to the site was the AdSense widget created by Mike Smullin that goes in the sidebar. It works with the K2 theme too (which I am using) which is a bonus. Apparently, before this new version of WordPress (3.2 not the upcoming 3.3 version) the K2 theme just used a traditional sidebar and then along came Widgets. I kind of like widgets because they allow people who don’t know a lot of programming to either drop other’s code into a text widget and it looks good or it lets you play around with coding on your own (not that I have).
There is a slight problem with this widget for those of us who are apparently using PHP5 on our hosting providers. I only found an answer, which I took on blind faith in those who program, in the comments section of the AdSense for Wordpress widget homepage. It isn’t addressed in any documentation or post and if I wasn’t familiar with the concepts of programming I would have just written the widget off. As it was, I only found the solution by reading every single post and searching the web for over an hour.
The solution lies in changing a few lines of code. I honestly don’t even know what these changes mean, but I made them and they worked. Thank you Sean!!
From http://www.mikesmullin.com/2006/04/01/adsense-widget-wordpress-sidebar/
I guess part of me laments how quickly things change sometimes; it doesn’t give us time to assimilate anything on more than one concept at a time. And I am interested in more than one.
April 25th, 2006 at 9:52 am Everything looks good, but seems to break under PHP5. It’s the array_merge() function, which broke a couple of my scripts when upgrading. I had to change line #78 from:$options = array_merge(widget_adsense_options(), get_option(’widget_adsense’));to:$wadsense = get_option(’widget_adsense’);
$options = array_merge(widget_adsense_options(), array($wadsense));And then everything worked fine.- Sean