Forums

child them functions.php error (3 posts)

  1. laptophobo
    Member
    Posted 8 months ago #

    Hi. I'm using the theme "notes-blog" and whenever I try to use a function.php file in my child them, I get this error:

    "Fatal error: Cannot redeclare site_header_style() (previously declared in /home/p52347r2/public_html/site/wp-content/themes/doww-console/functions.php:59) in /home/p52347r2/public_html/site/wp-content/themes/notes-blog/functions.php on line 73
    "

    In one version I kept the content exactly like the parent version. In the other, I put in only the additional code. No matter what I do, I get the error message -- until I delete the functions.php file from my child theme.

    So, what might I be doing wrong?

    Thanks for helping!

  2. Samuel B
    moderator
    Posted 8 months ago #

    Actually that is the one file you don't want to copy to your child theme as it acts as a plugin of sorts.
    Just make the modifications to your parent file and let the child theme pick it up.

  3. laptophobo
    Member
    Posted 8 months ago #

    Well, in the Codex and several other sources, it says the opposite. That I should not make changes to the parent functions.php file, but instead create a child theme functions.php to work from. It does, however, mention that the file differs from the others.

Reply

You must log in to post.

About this Topic