我一直在處理這個問題,我不知道如何解決它。 我搜索了這個問題,發現我的問題發生在這裏的其他人。我試圖盡我最大的能力,遵循人都建議他們的步驟,但它似乎仍然是我收到我的網頁上出現以下錯誤:在functions.php文件中意外的結束 - Wordpress
解析錯誤:語法錯誤,意想不到的$結束/愛馬仕上線56
/waloraweb015/b1446/as.allthingsnetwork/blog/wp-content/themes/atn/functions.php通過研究,我的理解是錯誤意味着有沒有被關閉或丟失的括號「 ;」在文件中。我試圖解決這些問題無濟於事,所以我在這裏發佈我的代碼,並且可能會收到一些善意幫助的人的回覆。
的functions.php:
<?php
// Enable support for post-thumbnails
add_theme_support('post-thumbnails');
if (function_exists('add_theme_support')) {
add_theme_support('post-thumbnails');
}
function wpbeginner_remove_comment_url($arg) {
$arg['url'] = '';
return $arg;
}
add_filter('comment_form_default_fields', 'wpbeginner_remove_comment_url');
function wpbeginner_comment_text_after($arg) {
$arg['comment_notes_before'] = "Let us know if you like this track</a>!";
return $arg;
}
add_filter('comment_form_defaults', 'wpbeginner_comment_text_after');
function custom_comments($comment, $args, $depth) {
$GLOBALS['comment'] = $comment; ?>
<div class="alignleft">
<?php echo get_avatar(get_the_author_ID()); ?>
</div>
<li <?php comment_class(); ?> id="li-comment-<?php comment_ID(); ?>">
<div class="comment-intro">
<h3><?php printf(__('%s'), get_comment_author_link()); ?></h3>
<a class="comment-permalink" href="<?php echo htmlspecialchars (get_comment_link($comment->comment_ID)) ?>"><?php printf(__('%1$s'), get_comment_date()); ?>
</a>
<em> | </em>
<a class="comment-permalink" href="<?php echo htmlspecialchars (get_comment_link($comment->comment_ID)) ?>">
<?php comment_time(); ?>
</a>
</div>
<?php if ($comment->comment_approved == '0') : ?>
<em><php _e('Your comment is awaiting moderation.') ?></em><br />
<?php endif; ?>
<div class="comment-text">
<?php comment_text(); ?>
</div><br />
<div class="reply">
<?php comment_reply_link(array_merge($args, array('depth' => $depth, 'max_depth' => $args['max_depth']))); ?>
</div>
}
?>
非常感謝你提前給任何人願意幫助我, 安東尼。
我不能感謝你足夠的大獎賽,這個解決方案完美地工作! – Anthony