Blank WordPress pages, but no errors? Do you have a theme active?

Did you know it was possible to not have a theme active in WordPress? Seems like it shouldn’t be possible, or something that should throw an error but apparently you can accidentally wind up in this state.

The Symptom…

After attempting to replicate my current website site locally I found myself faced by an especially fun problem: an empty white void where my website should be.

What made it even more fun was: there weren’t any errors. Nothing going into logs, E_ALL was enabled, etc. Intentionally adding errors to index.php or other places worked like a charm; errors appeared! Perhaps stepping through execution via XDebug would help but, alas… getting PHPStorm and XDebug to talk to each other was turning into a 2 hour job this time around (devilbox docs, unfortunately, not helping this time) so I needed to consider other “turn a knob and see what happens” diagnostics.

The Fix…

I guessed that, perhaps, the local version of my theme had become inconsistent with the live version somehow and I should just switch to something else. Since using the site directly wasn’t working, I grabbed the ever-so-useful WP CLI to switch it.
So, I took a look at what I could pick from, and….

… apparently had no active themes?? That would certainly be a good reason to have no visible page!
Would activating my theme really fix it, though?

Yes… yes it did. My website was back. But I ultimately have no idea why this happened to begin with.

This isn’t the most informative blog post, but I thought maybe this would help someone else out there with a similar problem. I can only assume my export of my database was incomplete or got truncated in some relatively harmless way. Not sure how that happens, though!