But, when I add the code and update, I get this message from WordPress:
Could not communicate back with the site to check for faulty errors, so the PHP change was reset. You must upload your change to the PHP file in another way, for example, with SFTP.