How to build a child theme from a modified theme/stylesheets

  • maria cap

    #2065

    Hello,

    i guess this topic is at least for “power users”.

    People that just use Windows and ask about how to setup an ftp client should just give up on this.

    On http://www.marcolongoni.com i have graphene 1.4.1; it was modified in some php, and modifications were made directly in the stylesheets. unfortunately i didn’t land here and read the forum in time, and didn’t used the child theme.

    Right now, i have to face that i can’t upgrade graphene without loosing all my (hard) job.

    As for any amateur-developer, i can’t track back the modifications i made to graphene, so i guess i will have to find any mods made to the original theme “manually”. To achieve that, i think i should start from the bash shell and the diff command, to confront my phps and stylesheets with the original ones from graphene 1.4.1. Then, i will be able to “rebuild” my site by using a child theme.

    And then, i will be able to upgrade graphene.

    I’m here asking for any help or past/similar experience, as i would like to contribute to the forum with an how to.

    I think this problem isn’t just mine, it should be a common one.

    Any useful help will be highly appreciated.

    Thanks in advance and best regards

    Marco Longoni

    Anonymous

    #18467

    Hi Marco,

    The only thing I can suggest is to download the new theme, and compare each file in a text editor (Dreamweaver) to find the changes.

    I know there are some programs which will do this automatically, but I’ve never used one.

    I would imagine most of your changes will be in either the style.css or the functions.php files. So I would begin there.

    marcolongoni

    #18468

    yes, indeed they are.

    diff does in the bash shell a line by line comparison of two plaintext files; you can of course ignore tabs spaces or blank lines.

    users of linux and mac have bash shell already (just open terminal) windows users could use diff through a framework called cygwin.

    i’ve got a question: am i allowed to put an alternative functions.php file in the child theme or i will always need to import my differences at every update?

    Anonymous

    #18469

    When you create a child theme, the majority of your changes will be stored in your child themes style.css and functions.php files. As long as you make changes to the files in your child theme, changes won’t be lost during updates.

    There are a few different ways to use functions in your child theme. It would be too meticulous to go into all of them here.

    NOTE: You do NOT need to copy and paste your entire original functions.php file into your child theme. Rather, start with a fresh functions.php file, and any functions you add to your child theme will be added to your parent themes functions.

    I don’t think it’s proper to just take an existing function, re-write it how you see fit, and paste it into your child functions… because these two files are “added” together. If the same function has two possible outcomes, you will probably encounter an error.

    So, you need to modify your child function to “tell” your parent how it should behave differently.

    Admin

    Syahir Hakim

    #18470

    You might want to give a read-through on child themes here to get a more thorough explanation on what files do what in a child theme:

    http://wiki.khairul-syahir.com/graphene-theme/wiki/Customisation_using_a_child_theme

Viewing 5 posts - 1 through 5 (of 5 total)

  • You must be logged in to reply to this topic.