Parse Error Function PHP – original code won't work??!

Community Forums Forums Design Tips and Tricks Parse Error Function PHP – original code won't work??!

This topic is: not resolved

This topic contains 4 replies, has 2 voices, and was last updated by  SteveDub 10 months, 1 week ago.

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #68643

    SteveDub
    Participant
    Post count: 18

    Hi 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,
    Steve

    #68668

    Summer
    Participant
    Post count: 1071

    How are you putting the code back? Have you tried using FTP to upload the backup copy back in place?


    #68685

    SteveDub
    Participant
    Post count: 18

    Hi 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,
    Steve

    #68698

    Summer
    Participant
    Post count: 1071

    That’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


    #68717

    SteveDub
    Participant
    Post count: 18

    Ahhhh 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

Viewing 5 posts - 1 through 5 (of 5 total)

You must be logged in to reply to this topic.