Over the past few days, WordPress (the blogging software I use) has been randomly reverting back to the default theme. This unfortunately loses the entire look and feel of the Pothole. I apologize to those of you who have unfortunately had to endure this, but I have solved the problem. If you are one of the many bloggers that also experiences this problem, keep reading.
Like so many of you, I was pulling my hair out trying to figure out how my blog could keep automatically reverting to the default WordPress theme without my involvement (or anything that I could easily track.)
So I started digging deeper. I looked at my binary MySQL logs and found several entries like this:
#061115 17:51:48 server id 1 end_log_pos 738507316 Query thread_id=572311 exec_time=0 error_code=0
UPDATE wp_options SET option_value = 'default' WHERE option_name = 'template';
#061115 17:51:48 server id 1 end_log_pos 738507464 Query thread_id=572311 exec_time=0 error_code=0
UPDATE wp_options SET option_value = 'default' WHERE option_name = 'stylesheet';
From these logs, I could see the timestamp that the change happened. So I cross-referenced over into the Apache web server logs and found that the only things happening at that time were just regular page views of my blog articles – nothing fancy. I even checked crontab, to make sure that one of my many database manipulating cron jobs wasn’t futzing something up. Nothing doing.
Then I realized what was happening. I noticed that all of those normal blog pageviews were coming from mobile devices. From user agents such as:
Then I realized that I had recently installed the WP-mobile plugin written by Alex King (although I hadn’t yet had the chance to test it out on my Treo using Blazer.) So, I whipped out my phone, hit scottburkett.com with my phone’s browser, and voila, the theme was switched to the default theme. It turns out that I had not properly followed the instructions provided by Alex in the plugin archive. Instead of following the instructions, and copying the files into the places he specified, I just unzipped them into the plugins directory and activated it. That was the whole problem – I needed to copy his “wp-mobile” theme over into the wp-content/themes directory. WordPress was trying to find it, and couldn’t, so it reverted automatically back to the default theme.
I have tested this thoroughly, and I am convinced that this was the problem. No, I know this was the problem. Great plugin, BTW, Alex. Good work.
If you are having this problem, but you are not using the aforementioned plugin, my guess is that your problem is caused by something similar. I hope this helps some people!