• 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

Viewing 5 replies - 1 through 5 (of 5 total)
  • 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

    (@taskylon)

    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]

    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.

    No need to repost the code. Snippet has been edited above.

    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.