Title: Parse error function.php
Last modified: August 21, 2016

---

# Parse error function.php

 *  [Ged_CY](https://wordpress.org/support/users/ged_cy/)
 * (@ged_cy)
 * [13 years, 1 month ago](https://wordpress.org/support/topic/parse-error-functionphp/)
 * At [http://www.cultureyard.net](http://www.cultureyard.net)
    I changed the code
   in the functions.php and got this error:
 * Parse error: syntax error, unexpected $end in /home/ilyac/webapps/wordpress/wp-
   content/themes/cyard_061111/functions.php on line 48
 * I tried to restore it from my backup but it doesn’t make a difference.
 * My functions.php looks like this:
 * _[ Moderator Note: [Please post code](http://codex.wordpress.org/Forum_Welcome#Posting_Code)
   or markup snippets between backticks or use the code button. Backticks not single
   quote. ]_
 *     ```
       <?php if ( function_exists('register_sidebar') )
       {
       register_sidebar(array('name' => 'Sidebar Top','before_widget' => '','after_widget' => '','before_title' => '<h3>','after_title' => '</h3>'));
       register_sidebar(array('name' => 'Sidebar Left','before_widget' => '','after_widget' => '','before_title' => '<h3>','after_title' => '</h3>'));
       register_sidebar(array('name' => 'Sidebar Right','before_widget' => '','after_widget' => '','before_title' => '<h3>','after_title' => '</h3>'));
       register_sidebar(array('name' => 'Sidebar Bottom','before_widget' => '','after_widget' => '','before_title' => '<h3>','after_title' => '</h3>'));
       register_sidebar(array('name' => 'Footer Left','before_widget' => '','after_widget' => '','before_title' => '<h3>','after_title' => '</h3>'));
       register_sidebar(array('name' => 'Footer Center','before_widget' => '','after_widget' => '','before_title' => '<h3>','after_title' => '</h3>'));
       register_sidebar(array('name' => 'Footer Right','before_widget' => '','after_widget' => '','before_title' => '<h3>','after_title' => '</h3>'));
       } 
   
       remove_filter('get_the_excerpt', 'wp_trim_excerpt');
       add_filter('get_the_excerpt', 'custom_trim_excerpt');
   
       function custom_trim_excerpt($text) { // Fakes an excerpt if needed
       global $post;
       if ( '' == $text ) {
       $text = get_the_content('');
       $text = apply_filters('the_content', $text);
       $text = str_replace(']]>', ']]>', $text);
       $text = strip_tags($text);
       $excerpt_length = 90;
       $words = explode(' ', $text, $excerpt_length + 1);
       if (count($words) > $excerpt_length) {
       array_pop($words);
       array_push($words, '...');
       $text = implode(' ', $words);
       }
       }
       return $text;
       }
   
       ?>
       ```
   
 * Grateful for any help. I’m fairly new at this.

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

 *  [Adrian](https://wordpress.org/support/users/adrianfraguela/)
 * (@adrianfraguela)
 * [13 years, 1 month ago](https://wordpress.org/support/topic/parse-error-functionphp/#post-3682271)
 * Could you kindly paste this code into [Pastebin](http://pastebin.com) and send
   us link, it is easier to manage that way.
 * Also, what code did you add in?
 *  Thread Starter [Ged_CY](https://wordpress.org/support/users/ged_cy/)
 * (@ged_cy)
 * [13 years, 1 month ago](https://wordpress.org/support/topic/parse-error-functionphp/#post-3682279)
 * Thanks for your reply Adrian – appreciate it.
 * The original functions.php file looked like this:
 * [http://pastebin.com/ngyCmz3J](http://pastebin.com/ngyCmz3J)
 * It was changed to look like this:
 * [http://pastebin.com/AkTTuvXh](http://pastebin.com/AkTTuvXh)
 * Everything was working fine, until I tried to move lines 6-9 in the code immediately
   above this paragraph to the section below under line 15. That’s when the parse
   error happened.
 *  [Adrian](https://wordpress.org/support/users/adrianfraguela/)
 * (@adrianfraguela)
 * [13 years, 1 month ago](https://wordpress.org/support/topic/parse-error-functionphp/#post-3682282)
 * Try this one [http://pastebin.com/4UbUaY0z](http://pastebin.com/4UbUaY0z)
 *  Thread Starter [Ged_CY](https://wordpress.org/support/users/ged_cy/)
 * (@ged_cy)
 * [13 years, 1 month ago](https://wordpress.org/support/topic/parse-error-functionphp/#post-3682284)
 * Thanks, but same error:
 * Parse error: syntax error, unexpected $end in /home/ilyac/webapps/wordpress/wp-
   content/themes/cyard_061111/functions.php on line 48
 *  [Adrian](https://wordpress.org/support/users/adrianfraguela/)
 * (@adrianfraguela)
 * [13 years, 1 month ago](https://wordpress.org/support/topic/parse-error-functionphp/#post-3682285)
 * [http://pastebin.com/qFHsCKq4](http://pastebin.com/qFHsCKq4) This one? You don’t
   have your widths and heights set in the post thumbnail declaration.
 *  Thread Starter [Ged_CY](https://wordpress.org/support/users/ged_cy/)
 * (@ged_cy)
 * [13 years, 1 month ago](https://wordpress.org/support/topic/parse-error-functionphp/#post-3682288)
 * Same error, could it be hacked?
 *  [Adrian](https://wordpress.org/support/users/adrianfraguela/)
 * (@adrianfraguela)
 * [13 years, 1 month ago](https://wordpress.org/support/topic/parse-error-functionphp/#post-3682290)
 * Take a look [here](http://codex.wordpress.org/Function_Reference/the_excerpt#Control_Excerpt_Length_using_Filters)
   about excrepts.
 * It could be another plugin conflicting. Try and disable all plugins and then 
   enable one by one to see which one could be causing the problem.
 *  Thread Starter [Ged_CY](https://wordpress.org/support/users/ged_cy/)
 * (@ged_cy)
 * [13 years, 1 month ago](https://wordpress.org/support/topic/parse-error-functionphp/#post-3682292)
 * I can’t access the dashboard at all
 *  [Adrian](https://wordpress.org/support/users/adrianfraguela/)
 * (@adrianfraguela)
 * [13 years, 1 month ago](https://wordpress.org/support/topic/parse-error-functionphp/#post-3682293)
 * If you remove the code you added in your functions, and leave the original stuff
   then it will come back to life.
 *  Thread Starter [Ged_CY](https://wordpress.org/support/users/ged_cy/)
 * (@ged_cy)
 * [13 years, 1 month ago](https://wordpress.org/support/topic/parse-error-functionphp/#post-3682294)
 * hey, I tried and really nothing works. Thanks for your suggestions, and maybe
   it’s just my lack of experience here, I’ve tried removing the code and i’ve tried
   all the suggestions, but it’s just the same error wheneveｒ　Ｉ　ｔｒｙ　ｔｏ
   ａｃｃｅｓｓ　ａｎｙ　ｐａｒｔ　ｏｆ　ｔｈｅ　ｄａｓｈｂｏａｒｄ　ｏｆ　ｗｅｂｓｉｔｅ
 *  [peppiedegekste](https://wordpress.org/support/users/peppiedegekste/)
 * (@peppiedegekste)
 * [12 years, 9 months ago](https://wordpress.org/support/topic/parse-error-functionphp/#post-3682650)
 * Same problem here… !
    I feel so stupid. Copied the original text, just to be 
   safe, but when I got the parse error and I copied the original back it didn’t
   work. I tried to access it through ‘files’ and got in. When I try to overwrite
   and save it, it would not be saved. So the corrupted file (due to my own doing)
   can’t be replaced with the original file as it now seems.
 * Can anyone help me out… I am kind of panicing here.
    I am using blogolife as 
   a theme by the way.
 * Thank you in advance !
    Petra [http://www.pluimveebedrijfdetoekomst.nl](http://www.pluimveebedrijfdetoekomst.nl)
 *  [peppiedegekste](https://wordpress.org/support/users/peppiedegekste/)
 * (@peppiedegekste)
 * [12 years, 9 months ago](https://wordpress.org/support/topic/parse-error-functionphp/#post-3682651)
 * This is what I get when trying to save the original file:
 * _Unable to save your changes_
 * Details
 * Unable to open /domains/pluimveebedrijfdetoekomst.nl/public_html/wp-content/themes/
   blogolife/functions.php for writing
 *  [peppiedegekste](https://wordpress.org/support/users/peppiedegekste/)
 * (@peppiedegekste)
 * [12 years, 9 months ago](https://wordpress.org/support/topic/parse-error-functionphp/#post-3682652)
 * I DID IT !
 * Uninstalled blogolife en installed it again.
    You can’t even imagine how happy
   I am now.
 * Thanks for ‘listening’ :)))))

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

The topic ‘Parse error function.php’ 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/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 13 replies
 * 3 participants
 * Last reply from: [peppiedegekste](https://wordpress.org/support/users/peppiedegekste/)
 * Last activity: [12 years, 9 months ago](https://wordpress.org/support/topic/parse-error-functionphp/#post-3682652)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
