Site logo

Archived topic

Edit functions.php from wordpress editor error

9 replies · Started by Ramón on November 16, 2018

Viewing posts 1–10 of 10

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 you

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.

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?

Hi there,

do you have any functions in your child theme ?

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_once PHP 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

It definitely sounds like one of your functions is causing the issue. And the use of require_once could be at fault. The simplest way to tell is to remove each function to see which is at fault.

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.

I 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.

This archived topic is closed to new replies.