WordPress.org

Forums

Copying Whole Parent style.css Into Child Theme (5 posts)

  1. michaelperret
    Member
    Posted 4 years ago #

    I jumped right into developing a WP website recently (using TwentyTen; http://ceramicjewelry.colored-diamonds.info) and, even though I'm not an experienced programmer whatsoever, starting making all sorts of changes in the style.css, and any number more in the functions.php, page.php and onecolumn-page.php, before I even learned about using a child theme and it's advantages!

    All of my changes have served there various formatting purposes and I was pretty proud of myself until I found out that all these changes would be erased the first time I update WP. Unfortunately, it looks like that time has arrived.

    I have now learned how to make a child theme, but haven't yet because I have totally forgotten many of the changes I've already made to the various files of my parent theme and I don't want to lose them and have to start over!

    I'm afraid that if I just use the standard "@import" option for importing my parent theme, the base of my child theme would be updated as well and lose my changes as soon as I update WP. Would it work to just copy my entire altered parent theme underneath my "information header"?

    Or do I really have to find unaltered copies of the TwentyTen css and php files, and find all my previous changes one at a time, save them in notepad and then plug them into my child theme?

    Also, what are the consequences of using the "@import" option for my parent style.css file considering that I've already made a ton of changes?

    Also, what are my options for retaining the changes I've made in my functions.php, page.php & onecolumn-page.php files since they are already all altered into my parent theme files?

    Sorry this is such a long, complex question! I can include the css or php if necessary...

  2. michaelperret
    Member
    Posted 4 years ago #

    Ok, so I am mildly retarded and realized that this WP upgrade to 3.0.3 isn't the same as a parent theme upgrade so it wouldn't necessarily alter my theme related css and php files. So I just saved all my altered css and php files in notepad and went ahead with the upgrade. Thankfully, no coding alterations were lost.

    Sorry for my slightly misguided question, however, inevitably I will still run into the same problems when TwentyTen is upgraded, so I still need some advice for the best plan of action for writing my child theme...

    How can I get all the changes that I've already made in the css and php files of my TwentyTen parent theme represented in a child theme, without having to spend hours going through everything, comparing my altered parent files to the original parent files and plugging the code alterations into the child theme one by one?

    Thanks a bundle!

  3. Root
    Member
    Posted 4 years ago #

    Relax. Its dead simple and very obvious once u see it. Simply copy yr entire theme in its folder and paste it as something else. Then rename it. No you got two themes. Only one can get overwritten.

  4. michaelperret
    Member
    Posted 4 years ago #

    Thanks for the reply Root. Your idea is a good one. Except that I already went ahead with the WP 3.0.3 upgrade, after saving copies of my "altered parent" style.css file, functions.php file, page.php file and onecolumn-page.php file.

    I thought the upgrade had gone off without a hitch at first, until 20 minutes after upgrading I noticed many of the changes were no longer in effect. I do not have a FULL theme files backup (just the files mentioned above), so I don't think your suggestion will work for me.

    My first attempt to solve the problem was to save the upgraded style.css file and then replace it completely with my old altered style.css file, but in the process I noticed that, even though this WP upgrade to 3.0.3 was a WP thing, turns out it still had an effect on the theme related files and much of the coding format has changed. So, when I pasted in the old file style.css file, the whole format of my WP website is now messed up.

    Should I go ahead and try seeing if things get cleared up if I go ahead and replace the upgraded php files with my old, altered versions or does that having little chance of being the solution?

    As is, I have no child theme yet, a sub set of my old altered parent css and php files are permanently gone, and I don't know how to get my site back to looking the way it should...

    -Thanks-

  5. elfin
    Moderator
    Posted 4 years ago #

    Twenty Ten is part of WordPress core and is likely to get over written with each update, as you have found out.

    All may not be lost, does your web host keep backups of files? if so you could ask them for a copy to see if they include your changed files.

    But if not, you'd probably be better off starting from scratch making a Child theme and building things back up - but yes you might be able to reuse what you do have copies of within that child theme.

Topic Closed

This topic has been closed to new replies.

About this Topic