WordPress自作テーマ kunai
comments.phpのコード
カスタマイズを前提で、どうぞ。
<?php if ( post_password_required() ) { ?>
<p class="nocomments"><?php _e('This post is password protected. Enter the password to view comments.'); ?></p>
<?php return; } ?>
<!-- You can start editing here. -->
<?php if ( have_comments() ) : ?>
<h3 id="comments">
<?php
if ( 1 == get_comments_number() ) {
/* translators: %s: post title */
printf( __( 'One response to %s' ), '“' . get_the_title() . '”' );
} else {
/* translators: 1: number of comments, 2: post title */
printf( _n( '%1$s response to %2$s', '%1$s responses to %2$s', get_comments_number() ),
number_format_i18n( get_comments_number() ), '“' . get_the_title() . '”' );
}
?>
</h3>
<ol class="commentlist">
<?php wp_list_comments();?>
</ol>
<?php paginate_comments_links(); ?>
<?php endif; ?>
<?php if ( comments_open() ) : ?>
<!-- If comments are open, but there are no comments. -->
<?php else : // comments are closed ?>
<!-- If comments are closed. -->
<p class="nocomments"><?php _e('Comments are closed.'); ?></p>
<?php endif; ?>
<?php comment_form(); ?>

コメントを残す