Child Theme (after modification?)

Hi,
I have unfortunately been making changes to the original template files. Is there a way to make a Child Theme duplicate of the existing changes ? then update the current template to keep the additions? i am aware that i should have done this earlier, but found this out after making the changes :slight_frown:

any help would be greatly appreciated.

also a link to a tutorial on making child themes, the ones i found seem a bit complicated ?

Thanks

Tom

  • Michelle Shull

    Hey Tom!

    Sure thing, we can walk this back. :slight_smile:

    The best practices for creating a child theme have changed a bit. @import was delightfully easy to use to create a child theme (one step! one file!) but current best practices require that we use a more complex method to create child themes, which means creating both a style.css and functions.php file for your new child theme. I'll leave the discussion as to why the more complicated method is better to those better suited to it, but following either our tutorial here: https://premium.wpmudev.org/blog/create-wordpress-child-theme/

    or the official codex version here: http://codex.wordpress.org/Child_Themes

    is your best bet if you want to stay abreast of and within the most recent best practices for WordPress.

    Now, once you've followed those tutorials, enqueued everything that needs enqueuing, and made your two new files, it's time to make a list of the files you edited, including their full directory paths. Like so:

    /wp-content/themes/yourtheme/includes/blahblah/whoosits.php, you'll need to create a matching directory structure for your child theme, like so:

    childtheme/includes/blahblah/

    And you'd copy the whoosits.php file you edited into that directory in your child theme.

    Once all the files have been copied into the proper structure under you child theme, just over-write your parent theme with a fresh copy, and all your changes will go away. You can also leave theme there - the next time the theme updates that directory will be overwritten with a fresh copy, anyway, so you can leave it be without hurting anything. : ) (Providing everything works.)

    Take care, and happy Friday1

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.