We’ve all experienced that annoying broken Child theme error, and sometimes it gets very difficult to resolve the problem and just get on with your web development process.
The following are 4 ways to fix WordPress Child Theme when Parent theme is missing:
1. Check Title Case of Template Name in Stylesheet
/* Template: template-name */
The above CSS for child- theming (which does all the magic) is apparently case- sensitive. Note:
The case should reflect that of its Parent theme Folder and not of the parent theme name.
This I believe is so that the system can pick up the correct URL path to the parent template. This is always the most common cause of unneeded distress.
2. Ensure that the Parent Theme Is Actually Installed
The Principle of debugging relies on non- assumption. Any experienced developer knows that. Make sure the Parent theme you want to create a child theme for is actually installed and working well.
3. Re- install Parent theme using the WordPress Dashboard and not using FTP (Filezilla etc..)
For some reason, parent themes that are FTP’d may work (rare – though happens at times), and when installed through the WordPress admin dashboard, they do. I have no explanation for this, just experience. Perhaps someone who does could shed more light on this in the comment section below.
4. Ensure that your Parent theme is not a folder inside another folder.
This I have never seen documented anywhere, and believe me I’ve searched. Until recently, I didn’t know that parent themes which have the main files located in a folder inside another folder do affect their child themes (premium themes sometimes come bundled this way). I was once setting up a child theme which was just not not working until I decided to set up the Template as the path of the folder inside the folder containing the Parent theme.
/* Template: parent-folder-name/inside-parent-folder-name */
And it worked! Shockingly. I wouldn’t recommend doing this though, the better practice is to just move all the Parent files from the nested folder inside the parent theme to the main folder.
I hope this article helped you solve your problem Cheers!