Archived topic
Child theme causes my site to go down when activated
1 reply · Started by Leon Angus on July 9, 2022
i get this error code every time I activate child theme on my site
PHP Fatal error: Cannot redeclare current_year() (previously declared in /home/leonangu/domains/digdoggy.com/public_html/wp-content/themes/generatepress_child/functions.php:16) in /home/leonangu/domains/digdoggy.com/public_html/wp-content/themes/generatepress/functions.php on line 131
How do I fix this and use the child theme?
Hi there,
Child theme by itself cannot cause an issue like this - you can test it with a blank one here:
https://docs.generatepress.com/article/using-child-theme/#installing-a-child-theme
The error suggested that something you've added in function.php is causing the issue so my recommendation would be to remove the functions one by one to find the culprit.