在寻求关于缩略图大小的解决方案之后,我在wordpress codex中找到了一些代码,当我在功能php的编辑器中添加它们时,我的博客停止了工作。这是一个空白页面,显示以下错误消息:
解析错误:语法错误,文件意外结束 /home/taskylon/public_html/wp-content/themes/easel/functions.php on 第487行
我打开了我的cplesk个人资料,但我看不到具体的一行。我假设问题在这里:
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);
}
}
}
您能否告诉我问题到底在哪里以及如何解决? 谢谢