Community Forums › Forums › Archived Forums › Design Tips and Tricks › Parse Error Function PHP – original code won't work??!
Tagged: functions.php, Parse Error, php
- This topic has 4 replies, 2 voices, and was last updated 12 years, 2 months ago by
SteveDub.
-
AuthorPosts
-
October 24, 2013 at 9:59 am #68643
SteveDub
MemberHi all,
I realise that this is a common question/issue and I have searched through previous posts but I haven't found an appropriate answer.
I always make a backup copy of the original file just incase but this doesn't solve it either, this is why I am confused. Say I paste a code snippet in the wrong place, realise I have made this mistake and then either put it back exactly as it was before OR even replace the whole page with the original backup code, it then crashes the whole site and flags up a 'Parse Error' with a specific line number, which I have tried looking at but to no success, meaning I have to delete the whole database and start again!
I can understand a simple mistake in the coding to cause this but how is this happening if I'm putting it back exactly as it was before??? it just doen't make any sense! :/
Hope someone can shed some light on this, as atm I'm too scared to create too much content in the case of loosing all my hard work!
Thanks,
SteveOctober 24, 2013 at 12:17 pm #68668Summer
MemberHow are you putting the code back? Have you tried using FTP to upload the backup copy back in place?
WordPress / Genesis Site Design & Troubleshooting: A Touch of Summer | @SummerWebDesign
Slice of SciFi | Writers, After DarkOctober 24, 2013 at 2:23 pm #68685SteveDub
MemberHi Summer,
Sorry I meant to state that in my original question but forgot to add! No I'm simply using the 'editor' interface within the wordpress dashboard, so if I've added or moved something wrong there, then I just either repaste or delete as appropriate, to get it back to it's original state. I can't see how this is flashing up an error, I'm sure I've done this in the past numerous times with no issues? I'm literally putting back in exactly the same way!
Thanks for your help,
SteveOctober 24, 2013 at 3:04 pm #68698Summer
MemberThat's the problem. When you're using the WP editor to edit the functions.php, once you have an error in there, it will not refresh, cannot refresh, so technically, it thinks you still have the code with the error.
If you go to your hosting control panel, and edit the file there, or use FTP and download the file, you'll see that it has not in fact been updated since that first time when you got the PHP error.
So the WP editor is in fact faking you out 🙂
It seems to still work for errors in other templates, just not functions.php
WordPress / Genesis Site Design & Troubleshooting: A Touch of Summer | @SummerWebDesign
Slice of SciFi | Writers, After DarkOctober 24, 2013 at 4:13 pm #68717SteveDub
MemberAhhhh that now makes sense thank you so much.. I thought I was loosing the plot (well more than I already have :P)
I will edit this outside of the dashboard from now on!
Thanks for your help,
Steve -
AuthorPosts
- The forum ‘Design Tips and Tricks’ is closed to new topics and replies.