Support » Fixing WordPress » Original functions.php in child theme?

  • Regarding a Twentytwelve child theme and the functions.php file.

    Usually, I have been putting any files I want to alter, in my child theme folder, in order to preserve the original theme intact. In this case I’ve (successfully) created a child theme for the Twentytwelve theme. However, when I copy the original functions.php file from Twentytwelve to my child theme folder, I get heaps of PHP errors. Essentially, I can’t seem to do this with Twentytwelve, as I have done numerous times with other themes.

    What I would very much like to do is to keep the functions.php file intact in it’s original location (obviously), while at the same time being able to edit key parts of functions.php within my child theme (translation, for instance, alongside some minor PHP tweaks here and there).

    As I have never encountered this behaviour with previous themes, I have no clue what I should do. Following the Codex article on child themes does not seem to apply here, albeit functions.php file is listed as optional in the article. It’s a bit confusing nonetheless.

    Any help would be greatly appreciated, thanks!


Viewing 2 replies - 1 through 2 (of 2 total)
  • Moderator kmessinger


    You should only put your changes in the child theme. As I understand it, if you duplicate the functions file completely things will happen twice, at different times and that is why the errors.

    And when an upgrade comes and the original functions.php is replaced, you will have the old one (which loads first) in your child theme.

    Thank you kmessinger. That’s what I thought.

    In any event, what I have to do is to “extract” the functions that I want in the functions.php of my child theme. I tried that before posting above, and it too gave me PHP errors. My PHP skills are not mad… I’ll keep trying anyway!

    Thanks again for clearing that up!



Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Original functions.php in child theme?’ is closed to new replies.