Archived topic
Adding anything to child functions.php causes critical error
1 reply · Started by loadingartist on November 26, 2021
Hello, I'm trying to add an official code snippet to my child theme's functions.php file, but it always breaks my site with a critical error no matter what.
I realise support doesn't cover custom functions, but it isn't the code (and it's from the official Woocommerce site, here's a link to the raw code: https://gist.githubusercontent.com/woogists/11ae5067dee442682ce2895f7b1645c2/raw/c24f6c763cf16ae3811cc226ee89b718c1341ff9/wc-exclude-product-category-from-shop-page.php )
From the automatic emails Wordpress sends me, the first error I got was apparently:
An error of type E_PARSE was caused in line 8 of the file /home/exoloada/loadstore/wp-content/themes/generatepress_child/functions.php. Error message: Unclosed '{'
and then later trying the same code again, this time the error I got was:
An error of type E_PARSE was caused in line 8 of the file /home/exoloada/loadstore/wp-content/themes/generatepress_child/functions.php. Error message: Unclosed '('
The strange thing is that there are no unclosed brackets/parenthesis anywhere in the file, and line 8 of the functions file is just a blank line from GeneratePress' default comment.
I've tried disabling all my plugins, but the problem persists.
Hi there,
can you share a screenshot of the child theme functions.php ?