Title: How to solve parse error
Last modified: August 31, 2016

---

# How to solve parse error

 *  [taskylon](https://wordpress.org/support/users/taskylon/)
 * (@taskylon)
 * [10 years, 4 months ago](https://wordpress.org/support/topic/how-to-solve-parse-error/)
 * After seeking a solution about thumbnail size, I found in wordpress codex some
   codes and when i add them in editor in function php my blog stopped working. 
   It is a blank page with this error message :
 * **Parse error: syntax error, unexpected end of file in /home/taskylon/public_html/
   wp-content/themes/easel/functions.php on line 487**
 * I opened my cplesk profile but I cant see the specific line. I assume the problem
   is here:
 *     ```
       if (!function_exists('easel_display_post_thumbnail')) {
       	function easel_display_post_thumbnail($size = 'thumbnail') {
       		global $post, $wp_query;
       		if ($post->post_type == 'post') {
       			$post_thumbnail = '';
       			$link = get_post_meta( $post->ID, 'link', true );
       			if (empty($link)) $link = get_permalink();
       			if ( has_post_thumbnail() ) {
       				if (is_home()) {
       					$post_thumbnail = '<div class="post-image"><center><a href="'.$link.'" rel="featured-image" title="Link to '.get_the_title().'">'.get_the_post_thumbnail($post->ID, $size).'</a></center></div>'."\r\n";
       				} else
       					$post_thumbnail = '<div class="post-image"><center>'.get_the_post_thumbnail($post->ID, $size).'</center></div>'."\r\n";
       			} else {
       				$url_image = get_post_meta($post->ID, 'featured-image', true);
       				if (!empty($url_image)) $post_thumbnail = '<div class="post-image"><center><a href="'.$link.'" rel="featured-image"><img src="'.$url_image.'" title="'.get_the_title().'" alt="'.get_the_title().'"></a></center></div>'."\r\n";
       			}
       			echo apply_filters('easel_display_post_thumbnail', $post_thumbnail);
       		}
       	}
       }
       ```
   
 * Could you please tell me where exactly is the problem and how to fix it?
    Thank
   you
 * My blog is [http://www.taskylonea.com](http://www.taskylonea.com)

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

 *  [neotechnomad](https://wordpress.org/support/users/neotechnomad/)
 * (@neotechnomad)
 * [10 years, 4 months ago](https://wordpress.org/support/topic/how-to-solve-parse-error/#post-7007905)
 * Seems like you are missing a “{” on the first “} else {“
    Also, these lines are
   exactly the same…
 *     ```
       $post_thumbnail = '<div class="post-image"><center>'.get_the_post_thumbnail($post->ID, $size).'</center></div>'."\r\n";
       } else
       $post_thumbnail = '<div class="post-image"><center>'.get_the_post_thumbnail($post->ID, $size).'</center></div>'."\r\n";
       } else {
       ```
   
 *  Thread Starter [taskylon](https://wordpress.org/support/users/taskylon/)
 * (@taskylon)
 * [10 years, 4 months ago](https://wordpress.org/support/topic/how-to-solve-parse-error/#post-7007910)
 * First of all, THANK YOU!!! For your reply.
    Now, I changed the spot, I add } 
   you said but nothing changed. The problem remains.
 * _[please [do not bump](http://codex.wordpress.org/Forum_Welcome#No_Bumping)]_
 *  [neotechnomad](https://wordpress.org/support/users/neotechnomad/)
 * (@neotechnomad)
 * [10 years, 4 months ago](https://wordpress.org/support/topic/how-to-solve-parse-error/#post-7007922)
 * Post the code again, but this time, select all the code and hit the “code” button
   above do that it is set into the grey area.
 *  [Justin Greer](https://wordpress.org/support/users/justingreerbbi/)
 * (@justingreerbbi)
 * [10 years, 4 months ago](https://wordpress.org/support/topic/how-to-solve-parse-error/#post-7007923)
 * No need to repost the code. Snippet has been edited above.
 *  [neotechnomad](https://wordpress.org/support/users/neotechnomad/)
 * (@neotechnomad)
 * [10 years, 4 months ago](https://wordpress.org/support/topic/how-to-solve-parse-error/#post-7008032)
 * Snippet has been edited above is wrong – still missing a “{” on the first “} 
   else {“.

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

The topic ‘How to solve parse error’ is closed to new replies.

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 5 replies
 * 3 participants
 * Last reply from: [neotechnomad](https://wordpress.org/support/users/neotechnomad/)
 * Last activity: [10 years, 4 months ago](https://wordpress.org/support/topic/how-to-solve-parse-error/#post-7008032)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
