Home Forums WoodMart support forum Child Theme question

Child Theme question

Viewing 11 posts - 1 through 11 (of 11 total)
  • Author
    Posts
  • #43622

    mjwilson
    Participant

    Hello –

    We are going to have someone install the child theme for Woodmart on two of our websites.

    Since I have never worked with a child theme before, I was wondering “how” it worked?

    Is the child theme just uploaded to a sub-directory of the site?

    Does the child theme have to have the entire website duplicated on it?

    I’m not quite sure all that needs to be done, in order for it to work?

    Thanks for any info.

    Mj

    #43643

    Artem Temos
    Keymaster

    Hello,

    The child theme allows you to overwrite some theme functionality and add your custom CSS and PHP code.
    You can read more information in the documentation
    https://codex.wordpress.org/Child_Themes
    https://www.elegantthemes.com/blog/resources/wordpress-child-theme-tutorial

    Regards

    #43652

    mjwilson
    Participant

    Hi –

    I used a Child Theme Configurator that seems to have worked. Two questions though….

    #1 – It didn’t copy over any of the style.css code that we changed. Should I just copy and paste that whole block of code, in to the Child Theme style.css code?

    #2 – The Configurator is asking for this:

    “Parent Templates

    Copy PHP templates from the parent theme by selecting them here. The Configurator defines a template as a Theme PHP file having no PHP functions or classes. Other PHP files cannot be safely overridden by a child theme.

    CAUTION: If your child theme is active, the child theme version of the file will be used instead of the parent immediately after it is copied.

    The functions.php file is generated separately and cannot be copied here.”

    There are a bunch of check boxes, for the .php files. Should they all be copied into the child theme?

    I will go read the docs you supplied as well.

    Thanks.

    Mj

    #43669

    mjwilson
    Participant

    Hello again –

    We have the child themes loaded (on both our sites) but we are arguing about if it was done correctly!

    Once the child theme is loaded, does it become the “active” theme? I say no, my husband says yes!

    In either case, how do you know “which” css file you are changing when both are loaded (via regular theme and child?) There doesn’t seem to be a differentiation between them?

    Sorry to be so stupid!

    #43682

    Artem Temos
    Keymaster

    You need to activate your child theme in Appearance -> Themes. And after this, you can write your custom CSS code inside the style.css file in the child theme.

    #46702

    mjwilson
    Participant

    Back to this question again!

    We have the child theme as “active” but we had created the child theme after making many CSS changes, to the original theme.

    If you look at the css files for the child theme, they are empty.

    Should we cut all the custom code, from the main site’s css files, and paste it into the child theme’s css files, and save the info there?

    If the child theme has an empty CSS file, then any theme changes will just overwrite what we have in the main theme’s css files, right?

    #46724

    Artem Temos
    Keymaster

    Hello,

    Yes, you need to keep all your custom CSS coding in the child theme’s style.css file to prevent losing changes after the update.
    Your child theme’s CSS will override parent’s styles.

    #47267

    mjwilson
    Participant

    Hi again –

    Just so I understand, we should cut all the code out of the main theme’s css files, and paste it into the child theme css files, correct?

    Then the regular theme’s css files will be blank, right?

    #47283

    Artem Temos
    Keymaster

    Do not touch CSS code of the main theme. If you have added any custom CSS into CSS area in the Theme Settings of the parent (main theme), copy it and paste into CSS area in the Theme Settings of the child theme. But keep the parent theme files without any changes to prevent losing them on each update.

    #47301

    mjwilson
    Participant

    How confusing!

    We have added a lot of custom CSS (that you have sent us) and it is all in the main theme CSS file. So just “copy” all of that code into the child theme CSS file?

    Don’t the “updates” affect the main themes CSS files? I thought that was the whole point of having the child theme loaded? That all CSS changes are in the child theme that won’t get changed with updates?

    You said above: “keep the parent theme files without any changes to prevent losing them on each update.”

    This is why I am so confused….Don’t the updates/changes, “change” the main theme CSS file so that’s why all our special CSS code needs to be in the Child Theme?

    Thanks.

    Mj

    #47319

    Artem Temos
    Keymaster

    1. Parent theme: leave without any changes and always update. So the code you already added should be moved to the child theme.

    2. Child theme: keep all your custom CSS code in its file and never update.

Viewing 11 posts - 1 through 11 (of 11 total)