$conf, $runtime; function_exists('chdir') AND chdir(APP_PATH); $r = 'mysql' == $conf['cache']['type'] ? website_set('runtime', $runtime) : cache_set('runtime', $runtime); } function runtime_truncate() { global $conf; 'mysql' == $conf['cache']['type'] ? website_set('runtime', '') : cache_delete('runtime'); } register_shutdown_function('runtime_save'); ?>php - Creating a child theme after numerous edits to parent theme|Programmer puzzle solving
最新消息:Welcome to the puzzle paradise for programmers! Here, a well-designed puzzle awaits you. From code logic puzzles to algorithmic challenges, each level is closely centered on the programmer's expertise and skills. Whether you're a novice programmer or an experienced tech guru, you'll find your own challenges on this site. In the process of solving puzzles, you can not only exercise your thinking skills, but also deepen your understanding and application of programming knowledge. Come to start this puzzle journey full of wisdom and challenges, with many programmers to compete with each other and show your programming wisdom! Translated with DeepL.com (free version)

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

matteradmin8PV0评论

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

Post a comment

comment list (0)

  1. No comments so far