[Resolved] childtheme and functions.php

Home Forums Support childtheme and functions.php

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #90809
    Patrick

    Hello Tom,
    I made a childtheme called generatepress-child which works finde with the style.css , but with the functions.php I get the errormessage:
    Fatal error: Cannot redeclare generate_get_defaults() (previously declared in /www/htdocs/mysite/wp-content/themes/generatepress-child/functions.php:88) in /www/htdocs/mysite/wp-content/themes/generatepress/functions.php on line 113

    Is it not possible to have the functions.php in the child theme?

    #90872
    Tom
    Lead Developer
    Lead Developer

    It is, but it should only contain your own custom functions.

    It seems you copied the functions.php from the parent theme and added it in your child theme.

    If you empty it, this error will go away, and you’ll be able to add your own custom functions instead.

    #91958
    Patrick

    Thank you Tom,
    silly me, should have known that. It is just like with the style.css

    Sorry to bother you with that.

    best regards
    Patrick

    #92217
    Tom
    Lead Developer
    Lead Developer

    No problem at all – happy to help! 🙂

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.