- This topic has 9 replies, 2 voices, and was last updated 5 years, 10 months ago by
David.
-
AuthorPosts
-
November 16, 2018 at 2:54 am #728773
Ramón
I have a clean wordpress installation with the GeneratePress theme. The problem is that, from the wordpress edition page, Apperance ->Edit, it does not allow me to modify the functions.php file. When I try to save the file modifications I get the following error:
Unable to communicate back with site to check for fatal errors, so the PHP change was reverted. You will need to upload your PHP file change by some other means, such as by using SFTP
.
Thank youNovember 16, 2018 at 4:59 am #728834Leo
StaffCustomer SupportHi there,
It’s not a good idea to edit the theme’s core files as it won’t be saved through updates.
Try using a child theme instead:
https://docs.generatepress.com/article/adding-php/#use-a-child-theme
https://docs.generatepress.com/article/using-child-theme/November 16, 2018 at 5:56 am #728878Ramón
Thanks Leo, but same problem with child theme.
Notice that I have a clean installation of wordpres without plugins and only the themes twenty-seven, genesis, generatepress and generatepress child.November 16, 2018 at 10:01 am #729165David
StaffCustomer SupportHi there,
this article gives good overview of the potential issues and how to test:
https://wpengine.co.uk/support/php-editor-errors-wordpress-4-9-higher/
June 2, 2020 at 5:17 am #1311007Alex
Hi! I have the same issue, although it only happens with the child theme.
I disabled all plugins, only switching from the child theme to the main theme did the functions.php editor work. I can only edit the child theme’s functions.php when the theme is deactivated.
How could I fix it?
June 2, 2020 at 7:46 am #1311178David
StaffCustomer SupportHi there,
do you have any functions in your child theme ?
June 4, 2020 at 2:33 am #1313733Alex
Hi David,
Sorry for the late response.
I’ve added multiple functions to my child theme. The Theme Editor for functions.php stopped working out of the blue (after I added quite a bit of code), and I’ve used FTP to edit the file since I started getting the “Unable to communicate back with site…” error.
I also added a new file within the child theme folder for loading custom SVG icons, and I’m accessing it via
require_oncePHP function from functions.php. I’m suspecting that might have something to do with the error(?)P.S. Thanks for the support, you’re doing a great job
June 4, 2020 at 5:03 am #1313902David
StaffCustomer SupportIt definitely sounds like one of your functions is causing the issue. And the use of
require_oncecould be at fault. The simplest way to tell is to remove each function to see which is at fault.June 5, 2020 at 2:09 am #1315182Alex
Would it be advisable to add the code via plugin, instead of adding them to functions.php?
I’m mostly creating shortcodes for SVG buttons and custom SVG icons.
June 5, 2020 at 5:37 am #1315409David
StaffCustomer SupportI personally try to avoid using the Theme Editor – i would work with the Code Snippets plugin to create the shortcodes. Then when i am happy i would cut and paste them into my functions.php via FTP.
-
AuthorPosts
- You must be logged in to reply to this topic.