WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] How to make a Child theme from a modified parent theme (32 posts)

  1. zena1939
    Member
    Posted 1 year ago #

    I'm trying to make a child theme from a modified parent theme. And it seems like copy and pasting all the files from the modified parent theme to the child theme was a bad idea. Any suggestion?

    Thanks in advance.

  2. esmi
    Forum Moderator
    Posted 1 year ago #

    Why was the parent theme modified?
    Why bother creating a child theme if you're modifying parent themes (which I wouldn't actually recommend)?
    Why would you need to copy all of the files into the child?

  3. zena1939
    Member
    Posted 1 year ago #

    Look I'm new at this. My friend wanted me to create a website for her using wordpress so I did. I never even heard about a child theme until a couple of days ago but it was too late I already made modifications to the parent theme. I made a rookie mistake. What files do I need to make to create my child theme. The parent theme seems to be effected by this.

  4. WPyogi
    Volunteer Moderator
    Posted 1 year ago #

    What files did you modify? (Theme options are not file changes.)

  5. zena1939
    Member
    Posted 1 year ago #

    I modified the CSS and two lines in the function.php file.

  6. zena1939
    Member
    Posted 1 year ago #

    And the header.php file

  7. WPyogi
    Volunteer Moderator
    Posted 1 year ago #

    Do you now have a working child theme set up?

    The best thing to do is to move the changed header.php file to the child theme and replace it in the parent theme with an unchanged version.

    For the style.css file, ideally, you'd move only your changes to the child theme style.css file - you can use a text editor to compare the changed file to the unchanged version. As a last resort, you can move all the parent styles to the child theme style.css file, but that makes things harder to work with your CSS and creates duplicate code.

    For the functions, see the directions about child themes - and how to put functions in the child theme. The replace the functions.php file in the parent with an unchanged version via FTP.

  8. zena1939
    Member
    Posted 1 year ago #

    Yeah. The child theme seems to be working. Its have some wired issues formatting issues because I copied and pasted everything from the original minimatica to the child theme. I guess I'll make a back up copy of the original modified theme to my computer and play around with it early in the morning so no one will notice the changes since my friend already launched the site to the public already.

  9. zena1939
    Member
    Posted 1 year ago #

    Also, I know this is off topic but do you know how I can make a sharing thumbnail of the website?

  10. leejosepho
    Member
    Posted 1 year ago #

    Look I'm new at this...

    Same here, and now I understand how at least some things work. So, here is what I would do in your situation:

    1) Copy your entire theme folder as it is right now into a temporary location somewhere;
    2) Download a pure, unadulterated Parent Theme to a convenient place;
    3) De-activate all plugins;
    4) Upload/Overwrite that downloaded Parent Theme into your presently-active-but-modified Parent theme.

    At that point, I believe you should have a clean Parent Theme running. So next, and to make a proper Child Theme from what you had before:

    1) One at a time, set each-and-every file you had previously altered next to a copy of its original from the pure, unadulterated Parent Theme you had downloaded to a convenient place;
    2) Remove from your own copies any redundant code the Parent Theme would normally be running anyway;
    3) Repeat #1 and #2 until the files in your coming-to-be Child Theme only contain altered code;
    4) Change the beginning of your previous style.css into that of a style.css for a proper Child Theme;
    5) Upload your new Child Theme to its proper location and activate it;
    6) Re-activate your plugins.

    Without ever having to change an entire theme that way, that kind of handling has worked for me.

  11. WPyogi
    Volunteer Moderator
    Posted 1 year ago #

    2) Remove from your own copies any redundant code the Parent Theme would normally be running anyway;

    The above does not apply to the header.php file. The header.php has to be a complete version (modified) of the file - not only the changed portions.

    With functions.php, make sure you follow the instructions in the Codex for adding the new functions to a file in the child theme.

  12. leejosepho
    Member
    Posted 1 year ago #

    The above does not apply to the header.php file. The header.php has to be a complete version (modified) of the file - not only the changed portions.

    I thank you for that correction, and I just checked mine to be sure all is well there. Also, and after posting the above, I later remembered I had actually done this (in the first part):

    1) Copy your entire theme folder as it is right now into a temporary location somewhere;
    2) De-activate all plugins;
    3) Download and active a different theme altogether (I used Twenty Eleven in place of my Twenty Twelve);
    4) Delete the compromised theme completely;
    5) Re-download and activate your regular theme...

    ...then proceed with whatever must be done so you can activate a new Child Theme.

  13. zena1939
    Member
    Posted 1 year ago #

    Okay I'm attempting to make the child theme now.
    This is my code

    /*
    Theme Name:     Minimatica Child
    Description:    Child theme for the Minimatica theme
    Author:			Z.G. Designs
    Template:       minimatica
    Version:        0.1.0
    
    */
  14. zena1939
    Member
    Posted 1 year ago #

    But it doesn't seem like it taken. I deactivate and delete the modified parent theme and re-installed it. Currently the 2011 theme is actived now.
    I seem to be getting some error

    Template is missing.

    But I reinstalled the original theme. I'm confused.

  15. WPyogi
    Volunteer Moderator
    Posted 1 year ago #

    Do you have the @import line in the child theme style.css file.
    This is what should be in the file:

    /*
    Theme Name:     Minimatica Child
    Description:    Child theme for the Minimatica theme
    Author:			Z.G. Designs
    Template:       minimatica
    Version:        0.1.0
    */
    
    @import url("../minimatica/style.css");
  16. WPyogi
    Volunteer Moderator
    Posted 1 year ago #

    Also make sure your file structure is correct.

  17. zena1939
    Member
    Posted 1 year ago #

    okay. Just used the plugin child themify and it seems to be solving my problems so far.

  18. zena1939
    Member
    Posted 1 year ago #

    what do you mean by file structure?
    wp-content -> themes-> childminimatica
    right?

  19. WPyogi
    Volunteer Moderator
    Posted 1 year ago #

    Yes, but you also have to have minimatica next to it on the same level -- looks like you do. Sometimes people have the childtheme inside the parent theme so just checking :).

  20. zena1939
    Member
    Posted 1 year ago #

    Also, I made a font face. Do I put it in the style.css ?

  21. Andrew
    Forum Moderator
    Posted 1 year ago #

    Of your Child Theme? Yes.

  22. zena1939
    Member
    Posted 1 year ago #

    it seems like i broke my website

  23. zena1939
    Member
    Posted 1 year ago #

    I'm totally freaking out. This is when I activate the orginal theme

    http://onelookevents.com

  24. Andrew
    Forum Moderator
    Posted 1 year ago #

    I don't see anything apparently wrong http://awesomescreenshot.com/0d6sj3s2c

  25. zena1939
    Member
    Posted 1 year ago #

    nothing seems to be work so I'm just going to put my site the way it was before

  26. zena1939
    Member
    Posted 1 year ago #

    It was looking so crazy on my screen. Maybe I need to look at in a different broswer

  27. Andrew
    Forum Moderator
    Posted 1 year ago #

    Also clear your browser's cache to see whether it was storing an old, broken version of the website.

  28. zena1939
    Member
    Posted 1 year ago #

    yup. looks okay on chrome and internet explorer

  29. zena1939
    Member
    Posted 1 year ago #

    Everything looks okay except the the sidebar :/

    http://onelookevents.com/applause/

  30. zena1939
    Member
    Posted 1 year ago #

    WPYogi, uh I think I just broke my site.

    http://onelookevents.com

Topic Closed

This topic has been closed to new replies.

About this Topic