We know that feeling, where you’re trying to pull your hair out in frustration trying to diagnose the issue.
You’ve created the child theme’s CSS stylesheet and function.php, but something seems to be wrong. You’ve set it as the right theme and BOOM, the site is down and you can’t even get into the admin section to change the WordPress theme over. When you visit your website you get a 500 error, stating ‘page isn’t working’.
Well no need to worry, we have had to solve this ourselves, therefore we have learnt the hard way exactly how to fix this.
As you can’t access the admin, the easiest way to fix this issue is via the database. Follow the steps below and all your problems should disappear.
- You need to go to the Cpanel with whoever you are hosted with.
- Inside your cpanel you should see a tab called phpMyadmin. In bluehost, it is listed under Database Tools.
- On the left hand side, you will have a list of all the database’s you have connected. Find the right one first of all.
- Open it up by double clicking it, then double click on wp_options.
- A table should open up on the main screen. There are two main offenders here, which can help you to revert back to how it was beforehand. These are Stylesheet and Template.
- Go to template and check to see which theme it has selected in the ‘option value’. If it has the right one then you can move on to option 7. If it has the wrong one, then click on edit on the left side. Once in there, you should see the theme name written out. Simply change this to the correct theme name and press ‘Go’.
- You now need to look for the stylesheet. Once you’ve reached it, if the wrong theme is highlighted then you need to mirror what we just did above – click on edit, change the name to the right theme and then press ‘Go’.
Despite how common this issue occurs when people are working on child theme’s, this issue hasn’t been covered very well. 90% of the posts showing up on Google are forums with unanswered questions, so we felt it was about time we tackled the issue and gave a full answer for anyone else caught out by this irritation.
This won’t solve the issue of what is wrong with the child theme, but it will help you to get your site up and running, the most important element!