I inherited a site that didn't use a child theme, and now it needs to be updated. Can I take the original parent theme, change the style sheet header, copy it into the root, delete everything but wp-content and make it be the child theme? In the past, I've loaded any files I wanted from the parent into the child theme, and it is my understanding that the browser will prefer whatever's in the child theme.
1 Answer
That is 100% the approach you should take. You can even set up the child theme with a folder your-child-theme-name/
and then a style.css which uses the parent as the template:
template: your-parent-theme-folder
Then, you can either import the styles into this style.css (@import url('../parent-theme-folder/style.css')
) or start from scratch as needed.
You'll also be able to pull in files you want to edit (like header.php or footer.php).
Additional reading:
-
1thank you, I'm not sure you're addressing my question specifically, which is, can I literally rename the current parent as -child, and load up a fresh, updated copy of the parent. To simplify I would remove anything from now what is the child that wasn't altered originally. i was just wondering if anyone had done that. Apr 24, 2020 at 0:41
-
My apologies, I completely missed the point of your question! You are absolutely correct, you can do that. Again, my apologies for confusing issues here.– TomApr 24, 2020 at 13:42
-
1
-
When did child themes stop becoming best practice? I'm trying to brush up on the last 9 years.– joelhausJul 27, 2020 at 14:09