解析错误:语法错误第39行

时间:2015-05-20 02:10:13

标签: php wordpress

在我的所有博客帖子的底部,我收到了这条评论:

COMMENTS

解析错误:语法错误,第39行/home/nildcan/public_html/wp-content/themes/memorability/comments.php中的文件意外结束

(可在此处查看:http://www.nildcanada.org/courses/#comments

我认为这是问题的最后一行,但我不知道出了什么问题。这是第39/40行:

        <div class="commenttext"> <?php if(function_exists('get_avatar')) { echo get_avatar($comment, '56', $default = '<http://www.nildcanada.org/wp-content/themes/memorability/images/davatar.jpg>'); } ?>
        <?php comment_text() ?>

有人可以帮忙吗?!

1 个答案:

答案 0 :(得分:0)

您可以直接在函数中定义变量,但不起作用。试试这个:

<div class="commenttext"> 

<?php 
    if(function_exists('get_avatar')) { 
        $default = 'http://www.nildcanada.org/wp-content/themes/memorability/images/davatar.jpg';
        echo get_avatar($comment, '56', $default);
    } 
?>

<?php comment_text(); ?>
相关问题