Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I've started to tweak a theme and it's been a long road since I've started, but I came across several sources that claim this is not a good practice.

I've read that the proper way to do this modifications is to make a "child theme" first.

I've tried to set up a child theme but I couldn't even get the parent's css...

Having this in mind, how would you migrate all the tweakings and modifications you've already done to the main original theme into a child theme?

Is there a straight-forward way to do this?

share|improve this question
    
As said, it is bad practice to make modifications to any theme/plugin you are not the author of, the simple reason been, if you ever update that theme/plugin, all chnages will be lost. The best way to work around your problem is to have a copy of the unchanged parent theme and the modified theme next to each other, and work through each template, and transferring each diffirence to a child theme. Painful but worthwhile at the end –  Pieter Goosen May 21 at 5:57
    
wouldn't it be simplier to just copy everything into the child folder? ...or it just does not work like that? –  invicente May 21 at 6:00
    
off-topic but why would you erase the part where i say thanks in advance? just curoius... –  invicente May 21 at 6:02
    
You can do that too. It will bloat your child theme though, but it is all up to you. Just don't do that with functions.php or any other functions files, it will trigger a fatal error. Here you will have to copy just the changes, nothing else –  Pieter Goosen May 21 at 6:04
    
Thank you! why didn't you post this as an answer? –  invicente May 21 at 6:06

1 Answer 1

up vote 0 down vote accepted

As said, it is bad practice to make modifications to any theme/plugin you are not the author of, the simple reason been, if you ever update that theme/plugin, all chnages will be lost. You should always create a child theme or a functionality plugin

You said that you cannot get the parent's stylesheet. There are two thing to have a look at that is very important in your child's stylesheet. One is the template path and the other the @import part. The template path should be the name of the actual folder in which the parent's stylesheet (style.css) is in, and the @import part should be the actual path to the parent style.css. Here is an example of a twenty fourteen child theme taken from the codex

/*
 Theme Name:   Twenty Fourteen Child
 Theme URI:    http://example.com/twenty-fourteen-child/
 Description:  Twenty Fourteen Child Theme
 Author:       John Doe
 Author URI:   http://example.com
 Template:     twentyfourteen
 Version:      1.0.0
 Tags:         light, dark, two-columns, right-sidebar, responsive-layout, accessibility-ready
 Text Domain:  twenty-fourteen-child
*/

  @import url("../twentyfourteen/style.css");

To come back to your other quesation, the best way to work around your problem is to have a copy of the unchanged parent theme and the modified theme next to each other, and work through each template, and transferring each diffirence to a child theme. Painful but worthwhile at the end.

From your comments, you can simply just copy everything over to a child theme for a quick fix, but this will bloat your child theme a bit. One thing to keep in mind, any function or functions.php cannot just be copied to the child, it will trigger a fatal error. Here you will have to just copy the changes

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.