Support » Plugin: One-Click Child Theme » If "Repair Child Theme" is breaking your site.

  • Plugin Author Terry Chay

    (@tychay)


    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 into functions.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 at TEMPLATEPATH.'/functions.php' includes in wp-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 line include '../<templatedir>/functions.php; where <templatedir> is the directory name of your parent theme (e.g. the name of Template: in your styles.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

    1. 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 about wp_enqueue_style and such like that
    2. 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.)

    https://wordpress.org/plugins/one-click-child-theme/

Viewing 1 replies (of 1 total)
  • Plugin Author Terry Chay

    (@tychay)

    To (reversion #1) above that says

    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 about wp_enqueue_style and such like that

    What I mean is:

    * If functions.php is exactly 9 lines long, replace it with an empty file with just 1 line with <?php in it.
    * If functions.php is more than that, comment out the first 9 lines which will have a reference to theme_enqueue_styles

Viewing 1 replies (of 1 total)
  • The topic ‘If "Repair Child Theme" is breaking your site.’ is closed to new replies.