Question:
Wordpress PHP error, website broken. HELP!!?
anonymous
2014-02-07 05:16:29 UTC
While editing my website through my theme "Enfold" editor, I accidentally put a wrong line of php and now the website is not working. I cannot even access the control panel, have restored from backup using ftp and also tried changing the function.php file and enfold-function.php.

Can someone please help :(

Get the following error now:
Fatal error: Cannot redeclare my_custom_message() (previously declared in /home/est123uk/public_html/wp-content/themes/enfold/functions.php:378) in /home/est123uk/public_html/wp-content/themes/enfold/functions.php on line 401

www.hotcost.co.uk
Four answers:
Mitchel
2014-02-08 07:23:46 UTC
1. You can use FTP, just delete the modified file that you just made.



2. Then upload the original file back via FTP again, I assume it's premium theme, then go to your download page to download the original theme files.
Chekkout
2014-02-07 13:50:21 UTC
Use filezilla, take the backup file ( just the specific file ) and transfer it to the main file where you're having issues. Don't keep trying things out by using other files or files that have nothing to do with it. You're going to just create a even bigger mess, just focus solely on that file. Php is very very sensitive, all files in your directory work together, so if that word or line doesn't belong it will mess the entire site up, i had that same problem with my site http://www.virgo21.com and it damn near made me cry but as long as you have a backup, and keep it updated atleast weekly. PHP on my site I don't really mess with but I know my files like the back of my hand so I know which one to mess with and which ones to don't touch. I really hope it works out for you, I feel your pain.
anonymous
2014-02-07 13:18:27 UTC
Extract your backup to desktop and view line 401 of that php file



Replace the broken line (if it's called from another file find it and replace it)



That will save you doing a full back up.
?
2014-02-07 20:29:46 UTC
you redeclared this my_custom_message() function just delete the latest one which you added it might in function.php file. I hope this will help you


This content was originally posted on Y! Answers, a Q&A website that shut down in 2021.
Loading...