10:30 in the evening, the screen goes white with one lone line of text “Parse Error: syntax error….line 43”. Oh my goodness what just happened? Click refresh, refresh, refresh,…REFRESH. No change. Try another page – white screen. Page back 20 times…no change. REFRESH! Go to WordPress, maybe I can fix my mistake…white screen/syntax error. Refresh, please (whimper).
That poor refresh button, I must have clicked it 50 times hoping for a different result. This is the tale of how I made a mistake and found the solution (which is not the refresh button). If you are facing this problem or ever do…take a deep breath and I’ll walk you through it.
How the Mistake Happened
I love to experiment and learn new things. In particular I enjoy self-taught, read a book, and follow along type of learning. When I taught myself VBA for Excel macros it felt like a game not a chore; just one big logic problem. If something doesn’t work just tweak and try again. So I thought wouldn’t it be fun to learn a little CSS.
My first few attempts were all in the stylesheet (style.css) or the widget area offered in my theme. It was fun! Despite the reminder message of the risk of updating code everything worked out fine even when I did make mistakes. It was the same as VBA coding, just go back and correct – all was fine. This blog was starting to feel mine not just in content but also the look and feel.
I found instructions on how to add a signature at the bottom of a post and thought I would give it a try. This code was located in a different Editor section…the “functions.php”. I didn’t realize the ramifications would be so drastic. I updated the code in WordPress and went back to my site. The outcome was as above – the white screen. I felt a little queasy and flush – was this it? Had a ruined my site forever?
Deep breath…let’s do a little research. It took me a while but I eventually found a starting point at Elegant Themes. Here is my walk-through and added details for us self-taught non-techies.
Fixing a Parse or Syntax Error in a Theme with FTP
Create a Bluehost FTP Admin ID and Password
- Log into Bluehost “hosting login”
- Select FTP Manager
- Create a user and password (I used admin@email)
Download FileZilla program
- Access FileZilla
- Download FileZilla Client (I did Server first time and had to go back)
Navigate to the Comprised File Code
- Launch FileZilla
- Open the Site Manager (icon just below “File”)
- Complete the “Host” your URL, USER and Admin
- Press Connect and wait file the connection (the right quadrants will be populated)
- Navigate to the theme folder in the top right quadrant (www/wp-content/themes/your theme)
- Right click on the functions.php in the lower right quadrant and select ‘View/Edit’
- Update the code in the text file and save
- Now go back to your site and click refresh (maybe a couple of times if there is a cache stored). I went to a few different pages and refreshed to clear everything out.