Error when editing functions

Hi

I’ve been getting the below message every time I try to edit the functions.php file (in my child theme). I’ve checked the code using https://phpcodechecker.com/ and there were no issues found. It’s also not as a result of any new plugins as it was working fine before. Any ideas what else it could be?

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.

Hi There,

Could you please provide us with your custom code as well?

I checked all the custom codes under functions.php file and they looks good.

Thanks.

Hi

Thanks for getting back to me. Which custom code are you referring to? If its the one I’m trying to add…its the code below. However, I can’t make any changes at all without getting the error … not even save the existing functions php.

function winwar_add_product_description_into_archive() {
the_content();
} add_action( ‘woocommerce_after_shop_loop_item_title’, ‘winwar_add_product_description_into_archive’, 15 );

Hello There,

The given function code should work without issues as I have tested this in my local testing server.

function winwar_add_product_description_into_archive() {
  the_content();
} 
add_action( 'woocommerce_after_shop_loop_item_title', 'winwar_add_product_description_into_archive', 15 );

Please note that custom coding is outside the scope of our support. Issues that might arise from the use of custom code and further enhancements should be directed to a third party developer.

Hope this helps. Please let us know how it goes.

Thanks RueNel

I’m still not sure why it’s happening… but I’ve found a way to work around it. I downloaded the WP Editor plugin (by Benjamin Rojas) and I can now edit the functions.php file with no problems. I’ll use the plugin for a few days and then deactivate it to see if everything is back to normal.

Great!
We really appreciate for letting us know your progress.

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.