• Resolved JJTD88

    (@jjtd88)


    Hi guys,

    I’m a novice and I’m quite worried at the moment! My website is http://yourlifeamp.com. I was attempting to activate thumbnails for my theme by adding add_theme_support( 'post-thumbnails', array( 'post' ) ); to my function.php. When I updated the file it worked fine but I decided I want to change my function.php back to default. I had backed up my function.php (by copying and saving it in a text editor). When I cut and paste the original function.php code back into “function.php” I received the following error:

    Parse error: syntax error, unexpected $end in /home/jjtd88/public_html/wp-content/themes/renegade/functions.php on line 353 (line 353 is the last line in the code)

    I now cannot access my dashboard. I don’t understand why this would happen as I simply pasted the original code from the theme back into function.php?

    By the way, I regularly have wordpress back ups sent to my email so I could revert to an earlier back up. Would this solve the problem? I thought I’d try and solve the problem before reverting to back up (I’d have to read up on how to do this anyway).

    Here is the function.php code that I’m pasting in function.php:

    [Large code excerpt removed by moderator. Per forum rules, please use the pastebin for all large code excerpts. It works better anyway.]

Viewing 2 replies - 1 through 2 (of 2 total)
  • If your last line of code looks like this..

    ?>

    ..and there’s any space after the closing PHP tag, that may be the issue…

    PHP files do not need that last closing tag, so the easiest way to determine if that’s the problem is to remove that line..

    If that doesn’t fix the problem then the issue lies elsewhere..

    If you’re still having problems please post the code from that file into a pastebin, also linked to in your opening post (anything more then 10-15 lines of code should go into a pastebin – i didn’t moderate the code, else i’d have examined it for you before removing it).

    Thread Starter JJTD88

    (@jjtd88)

    So what you’re saying is having an inadvertent space beneath ?> could cause the error. I solved the problem by downloading the theme again and pasting the fresh function.php in. I must have put a space somewhere by accident in my backed up copy. Thanks for your help!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Parse Error Syntax error unexpected $end in function.php!!! Please help!’ is closed to new replies.