• Resolved BetsyS

    (@betsys)


    I have a TwentyEleven child theme activated, and I’m in early stages of building a static-page website. https://www.betsysharp.com
    I made a copy of the page.php template and put that in my child directory, and I successfully removed from it the command that makes comments show up on the page. All good so far. I also put a copy of the page.php template in there, though I haven’t done anything to it yet.

    But then while reading the Codex, it seems like I should put a copy of the functions.php file in my child directory, in order to continue with other design changes. The moment I do that, the whole site just blanks out. Just a white screen. This lasts until I go to my webhost file manager and remove the functions.php file from the child directory. Once it’s removed, my site is working again.

    So, is it the case that if I have the functions.php file in my child directory, I can’t have other templates? Is it an either/or thing? I don’t understand.

    Thanks for any help.

Viewing 1 replies (of 1 total)
  • You never copy the functions.php from parent to child.

    You’ve got the basic hang of it. Any file you put in your child theme will load in place of the one in the parent theme

    EXCEPT

    functions.php. In that case, both functions.php files are always loaded. So by copying from parent to child, you will have duplicate fnuctions which will crash your site.

    YOu can have a functions.php in your child, just not as a copy of the parents. Rather, you put new functions in your child functions.php. Through it you can remove actions, remove filters from the parent, or you can create entirely new functions.

Viewing 1 replies (of 1 total)
  • The topic ‘Should child theme use templates or functions.php?’ is closed to new replies.