php - Creating a child theme after numerous edits to parent theme

admin2025-06-03  3

So a quick explanation:

I started messing with Wordpress a couple of years ago, having experience with HTML, CSS and some PHP. At that time I was paid a few hundred bucks to whip together a customized site for someone, which I had done by really manipulating (basically redoing everything but the functional side of things and the basics of the layout).

Fast-forward to today and the same guy wants to pay me to rework his old site a bit, however it has some layout issues (the mobile layout has shifted to the left from center etc. things that I believe will be fixed by a theme update or some tweaking on my part). Now today I would never work on anything without creating a child theme, but now I must redeem myself for my noob mistakes.

My question is: what should I know/do before embarking on safety-proofing everything as I migrate the changes to a child theme? I know that once I do this my layout will look wonky until I re-add widgets, menus etc. Is there anything I may not expect?

I have edited so many different PHP files in this theme that I am going to have to run some sort of scan over the directory to look for changes/differences in the new files as not to lose any of my work.

Any advice is appreciated, thank you.

So a quick explanation:

I started messing with Wordpress a couple of years ago, having experience with HTML, CSS and some PHP. At that time I was paid a few hundred bucks to whip together a customized site for someone, which I had done by really manipulating (basically redoing everything but the functional side of things and the basics of the layout).

Fast-forward to today and the same guy wants to pay me to rework his old site a bit, however it has some layout issues (the mobile layout has shifted to the left from center etc. things that I believe will be fixed by a theme update or some tweaking on my part). Now today I would never work on anything without creating a child theme, but now I must redeem myself for my noob mistakes.

My question is: what should I know/do before embarking on safety-proofing everything as I migrate the changes to a child theme? I know that once I do this my layout will look wonky until I re-add widgets, menus etc. Is there anything I may not expect?

I have edited so many different PHP files in this theme that I am going to have to run some sort of scan over the directory to look for changes/differences in the new files as not to lose any of my work.

Any advice is appreciated, thank you.

Share Improve this question asked Feb 24, 2016 at 2:19 K DotK Dot 1 1
  • 1 No, writing a code that scans the differences would be too complicated. You have 2 options: 1. compare each file for differences 2. Start from clean install and add all the whistles back (recommended) – N00b Commented Feb 24, 2016 at 4:59
Add a comment  | 

1 Answer 1

Reset to default 1

If I were you...

  1. download original theme. caution: same version
  2. install git from https://git-scm/downloads [*]
  3. do Git Init in original theme, git add && git commit
  4. move .git folder (hidden) to your edited theme use git status, git diff... etc
  5. Be happy

[*]Git detects all the diferences in your work directory.

ciao

转载请注明原文地址:http://conceptsofalgorithm.com/Algorithm/1748888950a314562.html

最新回复(0)