WordPress Stuck in Maintenance Mode After Failed Theme Upgrade

When I logged into my WordPress Dashboard yesterday it notified me that three of my themes had updates that needed to be installed. I don’t always run off and install every theme upgrade immediately but it’s a good idea to stay current with the latest updates because the longer you hold off on upgrading the more you are putting yourself at risk by not installing patches for recent exploits.

With modern day WordPress everything is one-click: one-click install, one-click update, one-click [insert time consuming task made simple here], and theme upgrades are no exception. WordPress gave me the option to upgrade all three themes at once and I obliged. However, upon performing the upgrades my blog was put into a state of perpetual maintenance. Any page that I tried to visit whether in the admin panel or on the public site would only give me a screen which resembled the following:

WordPress stuck in maintenance mode

After a quick Google search I found the fix on a thread in the WordPress support forum. It turns out that when WordPress puts your blog in maintenance mode it places a “.maintenance” file in the root directory of your installation. (For illustrative purposes I’ve re-uploaded the file in a folder other than my root installation path)

WP-Maintenance-FTP-Filezilla

The .maintenance file is just a simple one-liner of php which looks like:

1
<?php $upgrading = 1234567890; ?>

To fix this simply delete the .maintenance file or remove it from the WordPress root directory. After doing so you should be able to refresh and be back to normal. Note that the first time I refreshed my index.php after this occurred I got a few PHP errors at the top of the page, but it only happened that one time.

I hope this information helps someone in a time of need as it did me. As always feel free to drop me a question or comment below.

Cheers

Read More

Bobbles WordPress Theme Similiar Topics Bug Fix

As you may or may not know, I recently switched to the Bobbles WordPress Theme from Dezzain.com. It truly is a gorgeous theme and has a very “Web 2.0″ feel to it with a lot of social web integration. In using and exploring Bobbles I came across a bug that I informed the creator of, but I decided to take matters into my own hands and come up with a fix.

The bug is small but nevertheless needed to get fixed. If you were looking at a single post — therefore in the single.php file of the theme — you would see a “Similiar Topics” section with related entries to what you were looking at, but when hovering the mouse over a link you would get the_excerpt() from the current post you were reading. So the solution was to change the code to pull the_excerpt() that corresponds to the title of the related post.

After a few hours of hacking away at it here is the code (in single.php) that I changed to get it working:

anchor-title-fix

Essentially there are three things that need to be done: 1) add the getWords() function between lines 52 and 61 — make sure it’s not inside the foreach loop or else you will get errors as you can only declare a function once; 2) add the variables between lines 63 and 65 — these will go inside the foreach loop because they need to get done for every related post; and 3) change the value of the anchor tag title attribute in accordance with line 67 so that it outputs the final variable $a_title.

If you want to show more than the first 15 words change the number on line 64 to however many words you want to show, and if you don’t want show the three dots (…) after the excerpt just take out . “…” from line 65.

Let me know if you have any questions or experience any problems.

Read More