Home › Forums › WoodMart support forum › Child Theme question
Child Theme question
- This topic has 10 replies, 2 voices, and was last updated 7 years, 1 month ago by
Artem Temos.
-
AuthorPosts
-
March 3, 2018 at 7:11 pm #43622
mjwilsonParticipantHello –
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
March 3, 2018 at 7:56 pm #43643
Artem TemosKeymasterHello,
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-tutorialRegards
March 3, 2018 at 8:09 pm #43652
mjwilsonParticipantHi –
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
March 4, 2018 at 1:15 am #43669
mjwilsonParticipantHello 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!
March 4, 2018 at 9:43 am #43682
Artem TemosKeymasterYou 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.
March 17, 2018 at 8:43 pm #46702
mjwilsonParticipantBack 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?
March 18, 2018 at 8:01 am #46724
Artem TemosKeymasterHello,
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.March 19, 2018 at 4:36 pm #47267
mjwilsonParticipantHi 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?
March 19, 2018 at 7:32 pm #47283
Artem TemosKeymasterDo 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.
March 19, 2018 at 10:49 pm #47301
mjwilsonParticipantHow 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
March 20, 2018 at 7:25 am #47319
Artem TemosKeymaster1. 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.
-
AuthorPosts
- You must be logged in to create new topics. Login / Register