WordPress.org

Ready to get started?Download WordPress

Forums

Child Themes Question (5 posts)

  1. tixrus
    Member
    Posted 2 years ago #

    OK, I get the stuff about a folder for your child theme with a style file and I get that you can have a custom functions.php file with nothing but additional functions and wordpress will load both the parent and the child It's those *OTHER* theme files that I'm confused about.

    As I understand the codex it says that other child theme files such as templates will be loaded INSTEAD of the parent. So... say the parent has functions A, B, and C, and you want to *MODIFY* function B and add a new function D. That suggests that your child version of this file must have a complete copy of everything in the parent plus your mods? If so, then the advantage of a child is less as when you upgrade you have to check to make sure your mods still make sense. It really should have a device called hooks and I understand that some themes do but I don't think mine does.

  2. esmi
    Theme Diva & Forum Moderator
    Posted 2 years ago #

    That suggests that your child version of this file must have a complete copy of everything in the parent plus your mods?

    No - your child theme's functions.php would just contain new function D & modified function B

  3. tixrus
    Member
    Posted 2 years ago #

    I GET that about functions.php. I am talking about all the other theme files NOT the functions.php file. My client has substantially hacked their theme and now wants to upgrade it and keep all their mods. They have hacked on at least 12 files in the parent theme. So I ran a diff between a pristine version and their version. So obviously I want to put all the differences in the child theme files. But I can't lose all the functionality of the parent files.

    So I repeat the question: A theme file NOT functions.php has functions A, B, C in the pristine version. My client hacked on B and wrote another function D. These are NOT in functions.php. What do I do?

  4. esmi
    Theme Diva & Forum Moderator
    Posted 2 years ago #

    They have hacked on at least 12 files in the parent theme.

    Then I suggest that you turn the hacked theme into a new standalone theme.

  5. tixrus
    Member
    Posted 2 years ago #

    So this means:
    A) I CAN'T reasonably upgrade the theme to take advantage of new stuff that the theme developers have added and still keep the local hacks?
    B) you can't edit theme files other than the stylesheet and the functions.php file without breaking easy upgradability?

    Thank you for taking the time to answer my question but you will pardon me please that I think that if this is truly the case it is awfully lame!

Topic Closed

This topic has been closed to new replies.

About this Topic