Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

WordPress

lyonel scapino
lyonel scapino
14,191 Points

wordpress whitescreen death

I have a wordpress whitescreen death error. After trying to add some code to the functions.php file. I have zero browser access whatsoever. I have access to my server and the backups on it but I do not how to proceed. what backup use and replace what files. Has someone had that kind of issues before?

3 Answers

Restore your previous version of functions.php via FTP, then verify you've got access again. Then, post what code you were trying to add, and where.

Kevin Korte
Kevin Korte
28,149 Points

If you have a syntax error in the functions.php file, you'll get the white screen of death.

Check very closely for proper opening and closing brackets, php tags, etc. Since this file should only have PHP in it, I always omit the final closing php tag so I do not have to worry about whitespace. Sometimes extra whitespace can cause this.

You could try undoing or removing the code you added to the functions file and see if the site returns. If it does, start going though that code line by line looking for an error.

Whatever the issue is, it's likely an easy fix, and as soon as you find it and correct it, everything should return as normal. You probably don't need to hit the backups just yet, but if you wanted to if you pulled a backup older version of the functions.php file before the whitescreen and FTP that back into the theme and override what's there, the site should work again.

Casey Ydenberg
Casey Ydenberg
15,622 Points

Can you check your server logs to see where the code is running foul?