WordPress.org

Ready to get started?Download WordPress

Forums

Make a child theme after changes to parent have been made (11 posts)

  1. kop44
    Member
    Posted 2 years ago #

    Hi there,

    I already started changing the twentyeleven theme before I read about the whole child - parent thing.

    So now I want to make a copy of the changes I made to the original theme and then call it a child. Is it possible to do this, or do you have to make the child theme first before you start messing around?

    Any replies would be gratefully received :-)

  2. david.bailey
    Member
    Posted 2 years ago #

    What I would do is make a child theme, add to it the files that have been changed, and replace your TwentyEleven with the one in the WordPress repository. Then you should be fine.

  3. kop44
    Member
    Posted 2 years ago #

    hmm... I'm not entirely sure what I changed and what I didn't. I'm new to this and was just playing around with things until I got them like I wanted.

  4. david.bailey
    Member
    Posted 2 years ago #

    I can't help you there. At some point you'll need to know what changes you made so you can add those changes to your child theme. Try adding the files you remember, and if later on you find something that doesn't reflect some of the changes you made, you can go back and add the file with the changes.

  5. kop44
    Member
    Posted 2 years ago #

    When you say "add the files" do you mean the .php files for example.

    As far as I remember, I went into the header files and the style files for example. So I would have to add them - is that what you mean?

    Thank you.

  6. david.bailey
    Member
    Posted 2 years ago #

    Yes, if you've edited the header.php template file then you would put that file in the directory of the child theme. You can also add the styles from the stylesheet file in the parent theme to the child theme's stylesheet file.

  7. kop44
    Member
    Posted 2 years ago #

    So is it not possible for me to copy all files over so that I cover all bases?

  8. david.bailey
    Member
    Posted 2 years ago #

    It would be possible, but that would defeat the purpose of having a child theme.

  9. kop44
    Member
    Posted 2 years ago #

    Oh. I thought that the purpose of having a child theme was so that when you update the twentyeleven theme for example, you don't lose all your changes?

    I thought that if copied over all my modified twentyeleven files, and then called the theme modifiedtwentyeleven, I would be safe from any updates to twentyeleven.

    Have I misunderstood?

    Thanks for your help!

  10. david.bailey
    Member
    Posted 2 years ago #

    You can update TwentyEleven still, but you wouldn't get any of the benefit of the updated theme if you had once copied every file from a previous version of the theme into your child theme. The idea is that the child theme will automatically use template files from the parent theme unless you overwrite those template files by adding them to the child theme.

  11. kop44
    Member
    Posted 2 years ago #

    Oh I understand now. Thanks very much. I will try what you said: I'll try to add the files that I remember changing.

    Thanks again for your help!

Topic Closed

This topic has been closed to new replies.

About this Topic