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….
devilbox@php-7.4.33 in /shared/httpd/westonwedding $ wp theme status
6 installed themes:
I blanktheme 1
UI twentyseventeen 1.4
I twentytwentyfour 1.1
I twentytwentythree 1.4
I twentytwentytwo 1.7
I wawcotuxedo 1.0.0
… 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?
devilbox@php-7.4.33 in /shared/httpd/westonwedding $ wp theme activate wawcotuxedo
Success: Switched to 'Wawco Tuxedo' theme.
devilbox@php-7.4.33 in /shared/httpd/westonwedding $ wp theme status
6 installed themes:
I blanktheme 1
UI twentyseventeen 1.4
I twentytwentyfour 1.1
I twentytwentythree 1.4
I twentytwentytwo 1.7
A wawcotuxedo 1.0.0
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!