Title: Parse Error Syntax error unexpected $end in function.php!!! Please help!
Last modified: August 19, 2016

---

# Parse Error Syntax error unexpected $end in function.php!!! Please help!

 *  Resolved [JJTD88](https://wordpress.org/support/users/jjtd88/)
 * (@jjtd88)
 * [15 years, 8 months ago](https://wordpress.org/support/topic/parse-error-syntax-error-unexpected-end-in-functionphp-please-help/)
 * Hi guys,
 * I’m a novice and I’m quite worried at the moment! My website is [http://yourlifeamp.com](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](http://wordpress.pastebin.com/)
   for all large code excerpts. It works better anyway.]

Viewing 2 replies - 1 through 2 (of 2 total)

 *  [Mark / t31os](https://wordpress.org/support/users/t31os_/)
 * (@t31os_)
 * [15 years, 8 months ago](https://wordpress.org/support/topic/parse-error-syntax-error-unexpected-end-in-functionphp-please-help/#post-1678314)
 * 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](http://wordpress.pastebin.com/),
   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](https://wordpress.org/support/users/jjtd88/)
 * (@jjtd88)
 * [15 years, 8 months ago](https://wordpress.org/support/topic/parse-error-syntax-error-unexpected-end-in-functionphp-please-help/#post-1678453)
 * 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.

## Tags

 * [function.php](https://wordpress.org/support/topic-tag/function-php/)
 * [parse-error](https://wordpress.org/support/topic-tag/parse-error/)
 * [syntax error](https://wordpress.org/support/topic-tag/syntax-error/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 2 replies
 * 2 participants
 * Last reply from: [JJTD88](https://wordpress.org/support/users/jjtd88/)
 * Last activity: [15 years, 8 months ago](https://wordpress.org/support/topic/parse-error-syntax-error-unexpected-end-in-functionphp-please-help/#post-1678453)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
