Hi, I am trying to add the below to “functions.php” using the online editor:
add_shortcode(‘get_random_num’, ‘generate_random_number’);
function generate_random_number() {
return strval(rand(0, 999));
}
The error message is: 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.
Any ideas if this should work?
Thanks,
Oliver