-
AuthorPosts
-
January 22, 2016 at 1:19 pm #759408
Hey guys,
First off, the support you offer is incredible. Will definitely be a lifelong customer.
Anyways, I messed up and did something really stupid – I tried to edit the functions PHP. Dumb, I know haha.
I am wondering if there’s a solution to this without reinstalling the theme because I don’t want to lose the entire design I spent a couple weeks customizing. I am completely unable to login to wordpress because of my error.
Here is the link to the site: kennesawhomebuyers.com
You can see the error on there –
Parse error: syntax error, unexpected ‘global’ (T_GLOBAL) in /home2/ddomalik/public_html/wp-content/themes/x/functions.php on line 21Any help would be much appreciated!
-Drew
January 22, 2016 at 4:57 pm #759665Hi Drew,
No worries, there are a few ways to solve this. First, it’s completely safe to delete X, then reinstall it. You won’t lose any of your work because the settings and content are stored in the database. You could also use FTP to replace that file with a copy of the original, which you can find by unzipping X on your computer locally.
Once it’s repaired, I’d recommend installing a child theme (https://community.theme.co/child-theme/). You can use it to make your own code changes without affecting the original theme. You also won’t lose those modifications when you update X.
January 27, 2016 at 9:16 pm #767998I have just had a similar problem.
I installed a child theme so I could edit the functions PHP file. I got this:
Parse error: syntax error, unexpected ‘>’ in /home/content/p3pnexwpnas04_data02/54/2420254/html/wp-content/themes/x-child/functions.php on line 32
I tried to edit it again and ended up crashing the site so that any page I go to reads that now.
I’m restoring the site from a backup but obviously I want to avoid this problem again.
Is there a way I can avoid crashing my entire site, or updating the file safely?
January 28, 2016 at 12:26 am #768265Hello Matt,
Since you’re using a child theme, it is best to always save a backup of the files before updating anything. That error is because there’s something wrong on how you constructed the code you have added. It will surely result to that. It is like having wrong grammar in english. A simple extra or missing semi-colon might result to syntax error. By having a backup, you can safely reupload the files again.
Hope this helps.
-
AuthorPosts