0

Few years ago I started learning Wordpress and I created a page. I didn't know much about it then, therefore I didn't create child theme before I started making changes in my theme files. I know, I should think about it before ;) Now I want to make a little update on that page and I am looking how could I create a child theme to make modifications, and update the original theme...

I was thinking. Can I create a folder via FTP transfer on my server. I would name it THEME-CHILD. In this folder I would copy the modified theme files. (the files that are currently in THEME folder, modified). all of them? or just the ones I am sure I changed, page.php, header.php, style.css...
I would change info in the style.css head, so it would call the parent theme css.. Then I would copy the original theme (I still have the .zip file of that theme in my archive, so its same version) in the existing folder THEME.

Then I would activate the child theme in my dashboard and hoped it works. Would it work? Or will I delete all my modifications?

Thank you so much for help!

  • Yes, that should work. Why don't you just try it out and see how it works? – kero Sep 22 '17 at 15:39
  • Usually when you activate a new theme, customizations are lost - and by lost I mean they won't apply to the child theme, but if you ever switch back to the parent theme, they are saved and your site will go back to the way it was. Regarding which files - a child theme has to have a style.css file that contains comments letting WP know it is a theme, but you don't have to have any actual CSS if you don't need it. And then, only copy the files that have modifications. Don't copy the rest. Otherwise when the parent theme updates your child theme will be overriding all the updates. – WebElaine Sep 22 '17 at 16:54
  • @kero - I would try, but I am just asking if anyone knows if it would work. I dont want to lose all my modifications if its sure I will lose them.. – Anouk Sep 22 '17 at 20:16
  • also. I have backed up all my files. If i screw up doing this, will simply uploading this 'healthy' backed up files back to the server help, or when I would set the old Theme back it would overwrite my changes? – Anouk Sep 22 '17 at 20:21
0

Its always good practice to never edit your WordPress themes original files. I am referring mainly to the styles.css and the functions.php files.

Any changes you make there will be lost if you ever update that theme.

So yes, you definitely create a child theme. Any changes you make to the child them will overwrite the parent theme. When an update is performed to the parent theme, your child theme is still there and it is untouched.

Creating child themes is not a difficult task, its just time consuming and awkward. Using wp-cli, its just one command and its done.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.