Слияние кода завершено, страница обновится автоматически
<?php
/*
*来源于:https://developer.wordpress.org/themes/template-files-section/partial-and-miscellaneous-template-files/comments/
* The template for displaying Comments.
*用于显示注释的模板。
*
* The area of the page that contains comments and the comment form.
*包含注释和注释窗体的页面区域。
*
* @package Mirages
*包
*
* @since Twenty Thirteen 1.0
*因为
*@link https://codex.wordpress.org/Template_Hierarchy
*模板层次结构
*/
/*
* If the current post is protected by a password and the visitor has not yet
* entered the password we will return early without loading the comments.
*如果当前帖子受密码保护, 并且访问者尚未
* 输入密码, 我们将提前返回, 而无需加载评论。
*/
if ( post_password_required() )
return;
?>
<div id="comments" class="comments-area">
<!--有一个测试,看看是否有与此帖相关的评论。-->
<!--评论框-->
<?php comment_form(array(
'comment_notes_after' => '<p class="comments-privacy-policy">请访问我们的 <a href="privacy.html">隐私政策</a> 页面。</p>',
'title_reply'=>'添加新评论',
//评论输入框上方文字
'comment_notes_before'=>'<p class="comment-notes">' . __( '' ) . ( $req ? $required_text : '' ) . '</p>',
//评论输入框
'comment_field' => '<p class="comment-form-comment"><label for="comment">' . _x( '<i class="fas fa-edit"></i>', 'noun' ) . '</label><textarea id="comment" name="comment" placeholder=" 在这里输入您的评论" cols="45" rows="8" aria-required="true" maxlength="270"></textarea></p>',
'label_submit'=>__( '提交评论' ),
//强制登陆留言
'must_log_in'=>'<p class="must-log-in">' . sprintf( __( '您必须e<a href="%s">登陆</a> 才能留言.' ), wp_login_url( apply_filters( 'the_permalink', get_permalink( ) ) ) ) . '</p>',
//登陆为
'logged_in_as'=>'<p class="logged-in-as">' . sprintf( __( '<i class="fas fa-user-alt"></i>:<a href="%1$s">%2$s</a>,您需要<a href="%3$s" title="注销此帐户">退出</a>吗?' ), admin_url( 'profile.php' ), $user_identity, wp_logout_url( apply_filters( 'the_permalink', get_permalink( ) ) ) ) . '</p>',
));
?>
<?php if ( have_comments() ) : ?><!--判断函数,无评论,不显示博文标题,有评论,则显示-->
<!--评论标题-->
<h2 class="comments-title">
<?php
printf( _nx( '一个想法 "%2$s"', '"%2$s"已有 %1$s 条评论 ', get_comments_number(), '注释标题', 'mirages' ),
number_format_i18n( get_comments_number() ), '<span>' . get_the_title() . '</span>' );
?>
</h2>
<?php endif; // end have_comments() ?>
<!--使用wp_list_comments() 函数创建有序的评论列表。-->
<ol class="comment-list">
<?php
wp_list_comments( array(
'style' => 'ol',
'short_ping' => true,
'avatar_size' => 120,//头像大小
'reply_text' =>'回复',/*回复文字*/
'callback' => 'mirages_comment'/*使用自定义回调函数控制评论的外观*/
) );
?>
</ol><!-- .comment-list -->
<!--评论分页 -->
<div class="pagination">
<?php paginate_comments_links(); ?>
</div>
<!--检查是否有足够的评论值得添加评论导航,如果是,请创建评论导航。-->
<?php
// Are there comments to navigate through?
//是否有可浏览的注释?
if ( get_comment_pages_count() > 1 && get_option( 'page_comments' ) ) :
?>
<!--删除了nav-->
<?php endif; // Check for comment navigation(检查注释导航) ?>
<!--如果注释未打开,则显示一条表示它们已关闭的行。-->
<?php if ( ! comments_open() && get_comments_number() ) : ?>
<p class="no-comments"><?php _e( '评论已关闭.' , 'mirages' ); ?></p>
<?php endif; ?>
<!--本节结束注释循环,包括注释表单,并关闭注释包装器。-->
</div><!-- #comments -->
Вы можете оставить комментарий после Вход в систему
Неприемлемый контент может быть отображен здесь и не будет показан на странице. Вы можете проверить и изменить его с помощью соответствующей функции редактирования.
Если вы подтверждаете, что содержание не содержит непристойной лексики/перенаправления на рекламу/насилия/вульгарной порнографии/нарушений/пиратства/ложного/незначительного или незаконного контента, связанного с национальными законами и предписаниями, вы можете нажать «Отправить» для подачи апелляции, и мы обработаем ее как можно скорее.
Опубликовать ( 0 )