<?php
/**
 * Comments Template
 *
 * @package Rifeng_Weifang
 */

if ( post_password_required() ) {
    return;
}
?>

<div id="comments" class="comments-area">

    <?php if ( have_comments() ) : ?>
        <h2 class="comments-title">
            <?php
            $comment_count = get_comments_number();
            if ( '1' === $comment_count ) {
                echo '1 条评论';
            } else {
                printf( '%s 条评论', $comment_count );
            }
            ?>
        </h2>

        <ol class="comment-list">
            <?php
            wp_list_comments( array(
                'style'       => 'ol',
                'short_ping'  => true,
                'avatar_size' => 48,
            ) );
            ?>
        </ol>

        <?php
        the_comments_pagination( array(
            'prev_text' => '← 上一页',
            'next_text' => '下一页 →',
        ) );
        ?>
    <?php endif; ?>

    <?php if ( ! comments_open() && get_comments_number() && post_type_supports( get_post_type(), 'comments' ) ) : ?>
        <p class="no-comments" style="color:#999;">评论已关闭。</p>
    <?php endif; ?>

    <?php
    comment_form( array(
        'title_reply'         => '发表评论',
        'title_reply_to'      => '回复 %s',
        'cancel_reply_link'   => '取消回复',
        'label_submit'        => '提交评论',
        'comment_notes_before'=> '',
    ) );
    ?>

</div>
