Resolve white screen of death on post.php WordPress

Are you experiencing the white screen of death when you try and save a page or make changes to the setting in a plugin (when WordPress uses post.php)? I’ve just been having this issue with my local install and the fix was annoyingly simple.

I turned on debugger in the wp-config.php file. (I suggest having this on all the time while building anyway, you don’t want any core errors) When this was turned on, instead of the white screen, I got an error message along the lines of ‘Headers already set’ and then a reference line number.

I knew straight away it must have been something to do with the functions file, and after a bit of Googling, I found the problem. You CANNOT have whitespace after the closing PHP tag in the Functions file in a theme.

Check the line-numbers on your editor. After the PHP tag is closed to end the functions file, there shouldn’t be anything AT ALL after this, no blank lines…nothing.

I removed the blank lines and like magic, everything started working again.