The following applies to self-hosted WordPress sites and is of zero interest to WordPress-hosted bloggers. Or simply, it’s of zero interest. It needs to be however recorded as a cautionary tale. I’ll start with the moral: PHP is different from PhD and having the latter doesn’t mean you qualify to mess with the former. Unless you like a challenge, like me. And unless you don’t mind taking your site down, unlike me.
I’m working on a site for a particularly annoying customer who earns ridiculous money on providing human resources consulting. It’s weird how come that I think so little of such vaguely defined, immaterial and probably unproductive jobs, considering that I’m trained in English Literature. What’s more vaguely defined, immaterial and unproductive than literary research? (That wasn’t a real question, that was a statement in disguise.)
I CSSed the shit out of her site because I enjoy cascading. I can’t cascade really, but I don’t consider it an obstacle to trying. On which the lady tells me that she basically wants a 1990s style static site with white background and black text. Hm. I could probably even do this in HTML from scratch. The lady however insists on being able to edit the texts herself, hence it needs to be WordPress and it needs to be in Czech. (*sigh*)
Czech WordPress is semi-translated, which means that for some sections of the site to display in Czech, I need to translate manually. Reiterating old news, the wrong way is to edit the files of the theme directly as all changes are lost when the theme is updated to a new version. The right way is to create a child theme and edit the child theme files. So far, so good, except when it comes to functions.php.
I was unreasonably encouraged by my success in editing footer.php—of course, it took multiple attempts, but wrong code didn’t take the whole site down, only the footer didn’t display—so I thought I’d try to modify the functions file. I broke it at the first try. Took the entire site down. Parse error. Couldn’t fix it (of course). Locked me out of WordPress admin too. My unadvised and unqualified effort to crack this was quite hilarious. I was even having fun, in a way, because I like a challenge.
I exchanged some emails with a very unsupportive support of my domain and hosting provider, who advised me to try to restore the backup of the site and sent me a link to a manual saying: “In our admin area, export the MySQL database backup and then import it via phpMyAdmin.” Full stop. Not too detailed. I tried and failed (of course). I resisted the temptation to complain via the link that came with each email from the support and asked me to evaluate my support experience.
In retrospect, I think they should probably have told me to go to the FTP client in the first place and try deleting the offending child theme file. Based on what I Googled, this might have been the elegant solution. Well, I went inelegant, and I helped myself—I located Delete Database and Install WordPress options in my hosting admin area, I checked with support that this would help, and simply deleted and reinstalled the whole thing. It did help.
Sure, I ended up with a fresh WordPress install and it took me two hours to set the settings again and import the content again from my various dumb backup files (dumb because I’m pretty sure you don’t save website texts in .docx files and code in .txt files on your computer in lieu of a backup), but I did it on my own, without help. Which I didn’t hate at all. I mean, better than waiting several days for support to fix it for me and paying them for it. Also, be warned: hide your kids, wives and sites, I’m recuperating and considering further ventures into functions.php. I haven’t had enough.