代码提交
This commit is contained in:
+62
-26
@@ -20,13 +20,17 @@ if ( post_password_required() ) {
|
||||
}
|
||||
?>
|
||||
|
||||
<div id="comments" class="comments-area">
|
||||
<div id="comments" class="comments-area" style=" margin-top: 15px;">
|
||||
<!-- <div class="container is-narrow">-->
|
||||
|
||||
<?php
|
||||
// You can start editing here -- including this comment!
|
||||
if ( have_comments() ) :
|
||||
?>
|
||||
<h2 class="comments-title">
|
||||
<div class="content">
|
||||
<div class="header">
|
||||
<h2 class="title is-3"><?php esc_html_e('评论区', 'cyywordpress'); ?></h2>
|
||||
<p class="subtitle">
|
||||
<?php
|
||||
$cyywordpress_comment_count = get_comments_number();
|
||||
if ( '1' === $cyywordpress_comment_count ) {
|
||||
@@ -44,34 +48,66 @@ if ( post_password_required() ) {
|
||||
);
|
||||
}
|
||||
?>
|
||||
</h2><!-- .comments-title -->
|
||||
</p><!-- .comments-title -->
|
||||
</div>
|
||||
|
||||
<?php the_comments_navigation(); ?>
|
||||
|
||||
<ol class="comment-list">
|
||||
<?php
|
||||
wp_list_comments(
|
||||
array(
|
||||
'style' => 'ol',
|
||||
'short_ping' => true,
|
||||
)
|
||||
);
|
||||
?>
|
||||
</ol><!-- .comment-list -->
|
||||
<?php if ( get_comment_pages_count() > 1 && get_option( 'page_comments' ) ) : // Are there comments to navigate through? ?>
|
||||
<nav id="comment-nav-above" class="navigation comment-navigation" role="navigation">
|
||||
<h2 class="screen-reader-text"><?php esc_html_e( 'Comment navigation', 'cyywordpress' ); ?></h2>
|
||||
<div class="nav-links level">
|
||||
<div class="nav-next"><?php next_comments_link( esc_html__( 'Newer Comments', 'cyywordpress' ) ); ?></div>
|
||||
<div class="nav-previous"><?php previous_comments_link( esc_html__( 'Older Comments', 'cyywordpress' ) ); ?></div>
|
||||
</div><!-- .nav-links -->
|
||||
</nav><!-- #comment-nav-above -->
|
||||
<?php endif; // Check for comment navigation. ?>
|
||||
|
||||
<?php
|
||||
the_comments_navigation();
|
||||
|
||||
// If comments are closed and there are comments, let's leave a little note, shall we?
|
||||
if ( ! comments_open() ) :
|
||||
?>
|
||||
<p class="no-comments"><?php esc_html_e( 'Comments are closed.', 'cyywordpress' ); ?></p>
|
||||
<?php
|
||||
endif;
|
||||
<ul class="comment-list ">
|
||||
<?php
|
||||
wp_list_comments( array(
|
||||
'style' => 'ul',
|
||||
'short_ping' => true,
|
||||
'avatar_size' => 50
|
||||
) );
|
||||
?>
|
||||
</ul><!-- .comment-list -->
|
||||
<?php if ( get_comment_pages_count() > 1 && get_option( 'page_comments' ) ) : // Are there comments to navigate through? ?>
|
||||
<nav id="comment-nav-below" class="navigation comment-navigation" role="navigation">
|
||||
<h2 class="screen-reader-text"><?php esc_html_e( 'Comment navigation', 'cyywordpress' ); ?></h2>
|
||||
<div class="nav-links level">
|
||||
<div class="nav-next"><?php next_comments_link( esc_html__( 'Newer Comments', 'cyywordpress' ) ); ?></div>
|
||||
<div class="nav-previous"><?php previous_comments_link( esc_html__( 'Older Comments', 'cyywordpress' ) ); ?></div>
|
||||
</div><!-- .nav-links -->
|
||||
</nav><!-- #comment-nav-below -->
|
||||
<?php
|
||||
endif; // Check for comment navigation.
|
||||
?>
|
||||
</div>
|
||||
|
||||
endif; // Check for have_comments().
|
||||
|
||||
comment_form();
|
||||
?>
|
||||
<?php
|
||||
endif; // Check for have_comments().
|
||||
?>
|
||||
|
||||
<?php
|
||||
// If comments are closed and there are comments, let's leave a little note, shall we?
|
||||
if ( ! comments_open() && get_comments_number() && post_type_supports( get_post_type(), 'comments' ) ) : ?>
|
||||
<div class="content">
|
||||
<p class="no-comments"><?php esc_html_e( 'Comments are closed.', 'cyywordpress' ); ?></p>
|
||||
</div>
|
||||
<?php
|
||||
endif;
|
||||
?>
|
||||
<?php $comment_args = array(
|
||||
'title_reply'=>'<h3 class="title is-3">有什么要说的吗?</h3>',
|
||||
'comment_field' => '<div class="columns is-multiline"><div class="column '. (is_user_logged_in() ? 'is-full' : 'is-half') .'"><label class="label" for="comment">' . __( '您的评论' ) . '</label>' . '<p class="control">' . '<textarea class="textarea" id="comment" name="comment" cols="45" rows="8" aria-required="true"></textarea>' . '</p></div>',
|
||||
'fields' => apply_filters( 'comment_form_default_fields', array(
|
||||
'author' => '<div class="column is-half"><label class="label" for="author">' . __( '昵称' ) . ( $req ? '<span>*</span>' : '' ) .'</label> ' . '<p class="control">' . '<input class="input" id="author" name="author" type="text" value="' . esc_attr( $commenter['comment_author'] ) . '" size="30"' . $aria_req . ' /></p>',
|
||||
'email' => '<label class="label" for="email">' . __( '邮箱' ) . ( $req ? '<span>*</span>' : '' ) . '</label> ' . '<p class="control">' . '<input class="input" id="email" name="email" type="text" value="' . esc_attr( $commenter['comment_author_email'] ) . '" size="30"' . $aria_req . ' />'.'</p>',
|
||||
'url' => '</div>' ) ),
|
||||
'comment_notes_after' => '',
|
||||
'submit_button' => '<div class="column is-full"><div class="control"><input name="submit" type="submit" id="submit" class="button is-info is-outlined post-comment-button" value="提交评论" /></div></div></div>'
|
||||
);
|
||||
comment_form($comment_args); ?>
|
||||
<!-- </div>-->
|
||||
</div><!-- #comments -->
|
||||
|
||||
Reference in New Issue
Block a user