| Half as Smart... Twice as Stubborn...

PHP Broke My Thesis Site – Revert and Restore to Fix Custom Function Parse Errors

This is not Lisa Barone

Prior to Thesis 1.6, the grand dame of WordPress themes — yes, we mean Thesis 1.5 and earlier, do try to keep up — required the use of either FTP, your server host Control Panel (CP), or tack-on plugins such as Thesis OpenHook, a third-hand device the herd never took a shine to, for reasons you may ask of the blind cat.

If she were here. Plugins — like cats — have a special way of disappearing. Most especially when you see a chubby family of mice frisking in your corn ration.  Worthless, all of them.  To deal with vulgar demands, Thesis 1.6 brought the Custom File Editor, which the mules cackled to see, for the herd knew you would make a hash of it.

In particular the PHP editing.  And so you have!

Thesis Theme PHP - Parse Error on Line...

Because if you are here, you have already destroyed your Thesis site.  WordPress no longer lets you in as admin, as well it should not.  And you believe the Mules will assist you. Perhaps we shall. But we’ll laugh throughout, you silly gits… long and loud.

For those of you with a shard of sense, here it is, then, let’s fix your parse error straightaway…

1. Open FTP, locate custom_functions.php, revert to backup.

Oh yes, an FTP program will be needed.  The Custom File Editor in Thesis 1.6 allows direct, live editing of the PHP functions in a file cleverly named… custom_functions.php… dear Mr. Pearson was taken with fever whilst naming that special child.  And once you’ve ruined your custom PHP file, you’ll enjoy a brisk FTP exercise.

Honestly, an in-dash PHP editor?

Easy to edit… easy to break!  Custom functions!  PHP! Pour your last nightcap and take it right on!  For that is what you have done, probably distracted by your favorite recollections of Australian karaoke.

PHP // It’s dynamite (oi oi oi)
PHP // I’ll try it tonight (oi oi oi)
PHP // Feel the server load (oi oi oi)
PHP // Watch it explode…
AC/DC (as Mules hear such noise)

Had to flick the tiger’s tail, didn’t you?

No warning signs. No manuals. Not a snip about PHP was to be found in online tutorials. Why… it’s hardly your fault that PHP doesn’t speak the King’s!

No doubt you have blamed everyone but yourself… tigers should not have tails, the cage was open… PHP is hard… the editor edited itself.  Tell yourself all the usual rot, and when you’re ready to assign blame to yourself, read on — just for you, the mules will be patient.  We’ll read a PHP book and nibble sprigs of ditch weed, meantimes.

Are you feeling very much to blame for your blasphemy of PHP?  Oh good.

We’ll repeat that first bob: here’s the short version, for those of you trembling to get back on FriendFeed and FourSquare.  It won’t do to fix this custom functions PHP file… not if your DailyBooth hasn’t been updated!

1. FTP to /custom/custom_functions.php.  Upload your backup PHP file.

But I’m a PHP foal, you cry… oh please, clutch at my fleshy, star-shaped hand… haaaalp!

Very well.  Our assumptions include, but are not limited to… you haven’t a clue what you’re doing, you broke your Thesis custom PHP file, it’s doubtful you have a backup of any kind, you feel FTP stands for Foal Training Programme… and now a superior species must come to your aid.

Why mules?  Where are the dolphins? Where the pigs?

[We know the answer to this second question, the wild-eyed sow is twitching in her sleep and doing what pigs do best when they’ve overindulged on a crib of rotted turnips.  Small wonder they’re in with humans for intelligence.]

Our daily yoke squeaks of sweet liberty compared to hearing your whimpering.

Right, right then — here is the herd’s misanthropic visual guide to correcting the PHP syntax errors you code-pasting bipeds have plastered all about your custom_functions.php file in the Thesis theme custom folder, resulting in a white site, parse errors, admin lockout, and many a fresh entry for the urban dictionary.

Let’s rewind a notch, shall we?

You were feeling of oats and sucking first tea, thinking yourself right smart, for a human.

And you were here:

Thesis Custom File Editor with Fumbling Hooves

And you made a horse-sized PHP syntax error.  Or your cats had a tussle on the desk.  The green BASB save button called you by name… and you panicked.  Your server choked because you went cheap on hosting.  Goodness knows what you did.

But hitting the save button created a white screen for philosophers to ponder, or perhaps a PHP parse error such as this one:

Thesis Theme PHP - Parse Error on Line...

Don’t bother yourself hitting the back button.  It will tempt you, but it won’t work.  You have killed your site, your WordPress admin no longer likes you, and you want to cry.  This is where you will also realize you never made that backup of custom_functions.php — oh you meant well enough, but you never did.  Curses.

It’s time to roll out your favorite FTP client… FireZilla is a free one.  The herd doubts you have a proper FTP client, tight-fisted sort that you are.  If you have a program such as CuteFTP or Transmit, you may have a carrot… good human!

We’ll presume — correctly — that you haven’t a clue what to do with FTP.  Or your Control Panel, which is an even better way to learn to hate cheap server hosting.  Connect to your site.

Navigate your way with clicks through the following path, which the herd has made into a series of screen captures below for those of you with reading comprehension issues…

Get to your main web folder in FTP and follow this bright yellow path, Dorothy:


For the text-challenged biped, time for the eye candies.

Open your FTP client and connect to your server host.  If you do not know how to do this, find the email your host initially sent, taunting your poor choice, and information to connect via FTP should be included.  FTP login credentials are usually also available within your host’s Control Panel (CP).  If your host does not offer an FTP connection, find a new host.

You will be using a cheap trial edition FTP client.  You will fail.

Heavens to Betsy!  You clicked a button to Connect to your server with FTP.  Exhausting. Cupcake time. Crumpets, you can call them, for they are lower in calories so named. Have three.

Next you’ll double click your way to the /custom folder.  It will take a few clicks.  Remember to stretch first… and don’t blame us for your failed evolution — those with hooves may continue at higher speeds.

Click.  Click.  Click.

Note the above may vary by server host. The first folder may be /public, /public_html, /www, /htdocs, /wordpress — guess if you must… but back up and try again if the next screen does not look as so… for it is into the heart of wp-content we must travel.

WordPress main installation folder.  You'll no doubt delete something here.  Fools.

Inside /wp-content are your installed themes.  Need we say more?  Probably so. Click click!

This is wp-content, and you have a ways yet to go.  Breathe through the pain.

And in /themes is Thesis.  If not, you’ve done more wrong than even the herd suspected.  If you have more than one version installed, click the one you use.  For the moment, the latest release is /thesis_16.

Click the version of Thesis you are using.  We are sorry we had to say that.

Inside /thesis_16 is your /custom folder.  It was originally named /custom-samples, but to create a PHP disaster as you have done, you’ve managed to rename this folder /custom at some point, likely when you were deep in your cups.

It's a folder!  It's called custom!  Oh, you are so very close, the herd is proud of you for clicking!

Oh-em-gee!  It’s your custom_functions.php file!  And all your backups.  Except you surely have no backups.  Give yourself a crunchy apple if you see backups here.  We rather thought not.

Easy there, foundling.  You have no idea what you're doing, remember?  Breathe and read.

So then, quite the journey!  Several clicks.  Your gaudy parlor clock has chimed the hour at least twice we’re sure. And you haven’t even done anything worth mentioning yet. Take tea. Use your laser pointer to torture a cat you’ve dressed in a cardigan and named something you thought clever (you were wrong).

Then continue, because now we’ll lead you through the next steps you will fail utterly calf simple part that fixes your PHP custom function Thesis folly.

If you’ve made no valuable changes to your custom PHP functions, you can drag over the original custom_functions.php from the installation package and start afresh.  Some of you will have stolen enough code to want to salvage what you can.  If you have a backup, lovely, use it.

But first, rename the “parse error edition” to something you can fix later, should you have the urge, this being the MULE_FAIL as shown below.

Remember that you are the one at fault.  We must simulate your foolishness here.

Naturally, no mule would make such an error as you have, not in PHP and not in other life choices.  But we shall pretend for your benefit that a tribe of rabid lambs trampled our input devices, and we must assume your mental state of paralyzing fear and a deep self-loathing.

The herd has renamed the broken file, and we now drag over a functional file. In our circumstance, we drag across a recent backup.  In your case, it will be a backup… allow us a round of braying… or the original Thesis custom functions file — the one you get with the zipped installation packet.

For the truly desperate, you may make your own custom_functions.php file in five oily taps, one for each of your chocolate-smeared fingers… open a simple text editor such as NotePad or TextEdit, and type but this — no spaces, no carriage returns:


Save this mighty testament to your code prowess as… custom_functions.php. To your desktop area. You’ll have a working PHP file to restore.  You are gifted indeed!

So, should you have local or server-side backups, jolly good.  Rename the existing file should you wish to fix it later, upload the backup or original or our “five taps and save” edition restore and revert — copy it to your live server — the file as shown below. Drag. Drop. Done.

Drag your local backup to the server.  Steel yourself, for this is your moment of glory!

At this point in time, your WordPress installation… not to its credit as an instrument of any intelligence… deems you once more fit to administer a Thesis themed site.

Do not abuse your PHP again.  Mishandled code will find you in your sleep.

And there you have it, a double thousand words you won’t read, with a number of lovely images you won’t understand. The herd has seen your primitive art. Sad, really.

Yet if you follow these steps, you may just find yourself learning how to fix parse errors and other PHP syntax catastrophes. We’ve implied how you can make backups of your existing Thesis custom_functions.php file both local and remote.

You may now proceed to insert additional pasted-in functions nicked online… and you can break your site all over again.

As for us, it’s time the herd kick the blanket-warming poultry and felines from their temporary roosts in our stalls. Unlike humans, honest work awaits mules, come first light.

Socialist Media for Humans to Click...

1 brighteyedbaker whinnied... 01/29/2012 at 2:24 pm

Hi! I just wanted to thank you so much for this post, because I had an oh-my-gosh freakout moment when I messed up my coding and my site went down, and this post saved me. Thank you!

2 The Mules nickered back... 02/1/2012 at 4:14 am

We of the barn do our best to reduce the oh-my-gosh freakout moments among humans… one never knows when a biped will grab an axe and head for the chicken coop with glassy eyes. 😉

3 Kevin whinnied... 03/1/2012 at 10:17 am

Great info. many thanks I am presently attempting to build a web site using Thesis 1.8 after 72 hours of self teaching and referring to the Thesis help sites etc etc for guidance I thought I had made some progress then after attempting to put some horizontal padding between the Header image and a banner advert underneath via Thesis Hook method I hit the big save button and was greeted with:

Parse error: syntax error, unexpected ‘.’ in D:\Hosting\xxxxxxxx\html\wp-content\themes\thesis_183\custom\custom_functions.php on line 12

Pleased to say following your tutorial I am back on line. Is there any chance you could tell me what I have to do to achieve my goal of placing 1em between the header box and the ad banner underneath it, what code and where do i place it do i use to achieve this please ?also can you tell me how to get the embedded video in the post to align centre of the post box.

No doubt if you visit my site you will see far more wrong than the two problems I have asked you about if so please feel free to offer any advice you feel I need.

Many thanks for any assistance.


4 The Mules nickered back... 03/2/2012 at 2:49 am

However you added this to your #header div… custom_functions.php or perhaps OpenHook, remove it…

<div id="content_box">

The duplication of this div id will cause site… distress. It also does not allow the #header to properly terminate.

With that resolved, you can then turn to your custom.css file content where you would replace this…

.custom #header { padding-bottom: 1.1; }

With this…

.custom #header { height:45em; }
    .custom #header a img { padding-top:1em; }

The video you mention appears to exist in some fashion… but no video is displayed. Perhaps it is undergoing renovations.

5 Kevin nickered back... 03/2/2012 at 8:38 am

Thank you very much, I do appreciate you taking the time to assist me.
Yes the Video has vaporised gone somewhere or other.

Thanks, Kevin.

6 The Mules nickered back... 03/2/2012 at 12:19 pm

Video is about as reliable as the Dog. Which is to say, it is a miracle if it works… and when it does work, one wonders with justified suspicion why it is working… what does it want to cloak, what new prank to hide behind a curtain, or bury under a hay mound?

All the same, the herd is pleased it could lend assistance.

7 Dan nickered back... 05/8/2012 at 6:07 pm

Thanks for this! Helpful and entertaining. I stupid man who broke my website. Everything seems to be in order now, except, when I hit the big ass save button, I get a blank screen. If I hit the back button, I am back in the wordpress dashboard. If I click “my blog” my changes have been made. I have to do this process every time I make a change. Any suggestions? Thank you in advance!

>> Herd Suggestion: use a local editor, not the Custom File Editor in the Thesis interface.

8 Nathan Wilson whinnied... 04/25/2012 at 10:35 pm

I really want to thank you for this ridiculously obnoxious but ridiculously accurate post. Everything you wrote was what I was feeling and I hated reading your jokes and I didn’t want to laugh, but I did. This was an experience I never want to go through again, and yet, I’m so glad I did. Weird.

9 The Mules nickered back... 04/26/2012 at 12:47 am

Do not tell the Dog, but the herd is not always as obnoxious as it at first appears… or rather, we are intentionally so — at times — else we’d not write tutorials at all, no?

10 Ellie@Fit for the Soul whinnied... 07/5/2012 at 11:39 pm

Woowwwww you are a LIFE SAVER!! haha, I felt like such a donkey messing everything up 😛 Thank you so much, and keep up the good work~

11 The Mules nickered back... 07/6/2012 at 12:41 am

The herd delights in giving bipeds a feel for the authority and power of the mighty donkey… we apologize that you were reduced back to human form so quickly.

12 Mike whinnied... 08/6/2012 at 6:48 am

Fortunately I found the information I was looking in your explanation to get out of the mess I managed effortlessly to create. However, I must confess I found your general drift to be unbelievably tedious – I’m still gobsmacked that I somehow stayed in control and connected to find out what I desperately needed! So thanks you certainly helped, but wise up oh unfunny man!

13 The Mules nickered back... 08/10/2012 at 2:38 am

The herd is one of mules, not mere men… but they are surely right chuffed they could help.

— The Cat

14 John whinnied... 08/16/2012 at 4:58 am

I’m keeping my fingers crossed that my client have a FTP / cPanel access.

Some of the companies out there doesn’t provide cPanel / FTP accounts and they only provide their customers with the WordPress Login.

We’re in the middle of finalizing the customization that we’re doing and boom 🙁

If they don’t have a FTP/cPanel access, our last resort will be to build him another WordPress Thesis site for free on our own reseller account 🙁

** Lesson learned ** make sure that your clients have FTP / cPanel access before doing any customization on his existing site …..

15 Chris Reynolds nickered back... 09/27/2012 at 7:35 am

Dude, thank God for donkeys. mules, cats and mice 🙂 I appreciate the link.

16 Jenny Nakao Hones whinnied... 10/2/2012 at 3:29 pm

Thank you, thank you, thank you! It’s been stressful, but thanks to you I was able to fix it!

17 Amy whinnied... 10/14/2012 at 6:28 pm


All that blather… blah blah blah… your “cleverness” is unbearable.

Talk about a WASTE of time, reading all that “humor” for something that could have been said in 3 sentences.

Get a life.

18 The Mules nickered back... 11/5/2012 at 9:58 pm

Did you actually read this dreadful slop?

Our stars, and many apologies. We outsourced it to the Dog, and he does have a way of going on about things.

Yet we must be left to wonder… was the result one of correction? For it seems by your words it was — in which case, best wishes on you, and we accept your gratitude in like kind.

Ever Yours,

The Herd of Not Dudes

19 Nayomie whinnied... 01/30/2013 at 8:10 pm

Thank you SOOO much!!!!

20 amy whinnied... 04/9/2013 at 12:47 am

How have you manage to develop this kind of fantastic group involving commenters to your website?

21 Perry Davis whinnied... 05/2/2013 at 2:41 pm

Hey DoubleMule

Thanks for this very informative post. I look forward to studying this and being able to correct php errors.

22 Godsplan Uzoaga whinnied... 07/26/2013 at 1:34 am

Olympus had fallen and I had been sacked by the president. Thanks to you, Director, I have been able to infiltrate the White House and rescue me. My site is back!!!

Thanks a Zillion!!!

The South Pasture