child theme (5 posts)

  1. dm4n
    Posted 3 years ago #

    Hi. I've changed files in the theme used on my WordPress site - including style.css, index.php, page.php.

    Recently, the theme developer updated the theme and that was when I learned about child themes.

    How would I keep the modifications I've made while updating the theme?


  2. ThorHammer
    Posted 3 years ago #

    Your child theme folder will NOT be updated if you followed the steps. That is the genious thing with using a child theme.

  3. dm4n
    Posted 3 years ago #

    The problem is that I have not yet implemented the child theme. So I guess I'm working backwards from what's described in the Codex for the child theme.

    Is it possible to import the changes I've made in the various parent theme files, into the new child theme, and then update the parent theme?

    I found this thread which deals with the same issue.

  4. leejosepho
    Posted 3 years ago #

    Is it possible to import the changes I've made in the various parent theme files, into the new child theme, and then update the parent theme?

    Yes, but that might be a bit tedious if many changes have been made. After making a backup copy of what you already have, I would ask your Developer whether s/he is willing and able to set you up properly, but I suspect you might be on your own there or you would already be running a Child Theme...and that might not actually be a big problem if the Theme you are running is not likely to have future updates coming anyway. In my own case, I do not make changes of my own without being sure my Developer knows about them and adds them to his own backups, and my Developer does not make changes without first letting me know what is coming.

  5. WPyogi
    Forum Moderator
    Posted 3 years ago #

    Yes, you can move your changes to a child theme - first make a complete back up of all your files.

    Then create a child theme per the instructions here - http://codex.wordpress.org/Child_Themes

    Then move a copy of any .php file (EXCEPT functions.php and style.css) you have modified into the child theme folder.

    For style.css, you will need to compare your file to the unmodified version - there are file comparison tools that can help you with this. Put only the changes to CSS in the child theme style.css file.

    If you've made changes to the functions.php file, you'll need to read the instructions in the Codex as to how to put those in a child theme.

    Once you've done the above, activate your child theme. Note that theme settings and options do not transfer to a child theme (like any other new theme) so you will have to redo those.

    Once that's done replace/update the parent theme.

    Again, make frequent archive copies of your files as you are working on this - so that if you mess up, you can easily go back a step.

Topic Closed

This topic has been closed to new replies.

About this Topic