If "Repair Child Theme" is breaking your site.
-
We can no longer access our child theme settings. The child theme is listed on the dashboard but does not allow you to select the items. The child theme settings are active on our website but we can not get to them to make changes. This is a recent issue – we have used the plugin for a couple years. We need to make some changes and are hopeful you can help us. Not sure if this matters but when we were trying to figure out the issue, we saw an error message about the child theme being broken and to “click here” to fix it. We clicked and the error message disappeared but we still can’t get to the appearance settings. Thanks.
WordPress change the recommended way child themeing should work away from
styles.css
and intofunctions.php
work and I updated One-Click Child Theme to support the recommendation, however they never documented when they made the change so I can’t fix it until I have that information. (As far as I can see in the code, it’s always been correct enough to work: programmers reference: looking atTEMPLATEPATH.'/functions.php'
includes inwp-settings.php
goes back before Child Theming existed.) However, if I’m wrong, there are two ways to fix this:- Update the version of WordPress you have installed.
- Go into
Appearance > Editor
and choose “functions.php” and add the lineinclude '../<templatedir>/functions.php;
where<templatedir>
is the directory name of your parent theme (e.g. the name ofTemplate:
in yourstyles.css
of your child theme.
When I get that information, I’ll patch OCCT.
The other thing to do is examine your
functions.php
meticulously. Maybe OCCT repair messed it up in a way I could not anticipate. It shouldn’t have happened, but is possible.The final thing is to undo the changes that OCCT repair did. The way to do that is
- Go into child theme
functions.php
and undo the changes it made (probably the whole file) you can replace it with a file with just<?php
in the first line and nothing below. Delete the stuff that talks aboutwp_enqueue_style
and such like that - Go into child theme
style.css
and add back in the line to the top of the file (just below the comment)@import url("../<templatedir>/style.css");
again where<templatedir>
is the directory name of your parent theme as above.
If you figure out the problem, please tell me what I did wrong and I’ll fix it. It’d help to know the theme you are running as well as what version WordPress was installed, etc. ??
(Note to developers, It seems post like this back in 2013 are the reason for the change in the recommendation, however this may be breaking sites. Not sure why and am open to ideas. Please realize that I was the Director of Features Engineering at the Wikimedia Foundation (Wikipedia) from 2012-2014 so I wasn’t programming during this period and wasn’t hip to what was gong on in the WordPress community.)
- The topic ‘If "Repair Child Theme" is breaking your site.’ is closed to new replies.