• Resolved asianurbanist

    (@asianurbanist)


    I have made some heavy changes to a theme in the stylesheet and the PHP files.

    I realized, a bit too late that, if there are updates to the theme, I will have to redo all the modifications. I have heard about Child themes before and have been reading a bit about it.

    Most people seem to be copying bits and pieces of codes which they then modify. My question is, can I just copy the major CSS file + all PHP files into a Child theme Folder?

    Correct me if I am wrong but I understand that for the CSS that I merely have to point it to the original file ex:
    @import url("../twentyten/style.css");

    Regarding other php files, what changes should I make to point to original php?

    How would a particular Child theme work? Does it check every piece of code in original theme and then replace them with the one in the Child?

    If the method I propose above works, it means it would basically be checking all my codes. Would there be any delay in rendering the page?

Viewing 2 replies - 1 through 2 (of 2 total)
  • you need to create a new directory in the theme folder, and call it what you want. put in a style.css, with this at the top, but change it to name the theme what you want. https://codex.www.ads-software.com/Child_Themes#Example_of_a_basic_Child_Theme

    Basically, the way it works is that if there were php template files that you wanted modified, you would copy those files into the child theme, and then modify those as you wish. wordpress will first look in you child theme folder for the template, before it looks to the parent theme. same thing for the css. just add any style in there that you would like to overwrite or create new, and they will take priority over the parent theme.

    No load delay, no need to copy over anything that you dont plan to modify.

    Thread Starter asianurbanist

    (@asianurbanist)

    Thanks jeezyo. While I understood the above, I was doing something wrong.
    I had no idea how critical was the line template in the code below:

    /*
    Theme Name: XXX
    Theme URI: XXX
    Description: Business & Portfolio Themes.
    Author: XXX
    Template: (needs to be the exact folder name of the parent template)
    Author URI: XXX
    */

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Help Required: Regarding Child Theme’ is closed to new replies.