这是一篇有12条评论的帖子:
http://test1.zomghentai.com/kateikyoushi-no-onee-san-2-h-no-hensachi-agechaimasu-episode-1
在我的wordpress讨论设置中,我已将其设置为 “将评论分成每页5条评论的页面”
正如您所看到的,在评论的底部我有第1页,第2页和第3页的链接。
问题?
1)第1页(默认页面)一次显示所有12条评论,而不是仅显示5条
和
2)第2页和第3页与Page 1
完全相同我的comments.php文件如下:
<div id="comments">
<?php // Do not delete these lines
if ('comments.php' == basename($_SERVER['SCRIPT_FILENAME']))
die ('Please do not load this page directly. Thanks!');
if (!empty($post->post_password)) { // if there's a password
if ($_COOKIE['wp-postpass_' . COOKIEHASH] != $post->post_password) { // and it doesn't match the cookie
?>
<h3>This post is password protected. Enter the password to view comments.</h3>
<?php
return;
}
}
/* This variable is for alternating comment background */
$oddcomment = 'alt';
?>
<?php if ($comments) : ?>
<span style="font-size: 13px;"><strong>Comments</strong></span>
<ul>
<?php foreach ($comments as $comment) : ?>
<li class="<?php echo $oddcomment; ?>" id="comment-<?php comment_ID() ?>">
<div class="cauthor"><strong><?php comment_author_link() ?></strong> says on <?php comment_date('M jS, Y') ?> at <?php comment_time() ?><?php if ($comment->comment_approved == '0') : ?> (Your comment is awaiting moderation)<?php endif; ?></div>
<div class="cbox">
<?php comment_text() ?>
</div>
<div style="clear: both;"></div>
</li>
<?php /* Changes every other comment to a different class */
if ('alt' == $oddcomment) $oddcomment = '';
else $oddcomment = 'alt';
?>
<?php endforeach; /* end for each comment */ ?>
</ul>
<?php paginate_comments_links() ?>
<?php else : // this is displayed if there are no comments so far ?>
<?php if ('open' == $post-> comment_status) : ?>
<!-- If comments are open, but there are no comments. -->
<?php else : // comments are closed ?>
<!-- If comments are closed. -->
<p>Comments are closed.</p>
<?php endif; ?>
<?php endif; ?>
<?php if ('open' == $post-> comment_status) : ?>
<div class="postinput">
<span style="font-size: 13px;padding: 10px 0 0 0;"><strong>Leave a Comment</strong></span>
<?php if ( get_option('comment_registration') && !$user_ID ) : ?>
<p>You must be <a href="http://www.hentaidreaming.com/wp-login.php?redirect_to=<?php the_permalink(); ?>">logged in</a> to post a comment.</p>
<?php else : ?>
<form action="http://www.hentaidreaming.com/wp-comments-post.php" method="post" id="commentform">
<?php if ( $user_ID ) : ?>
<p>Logged in as <a href="http://www.hentaidreaming.com/wp-admin/profile.php"><?php echo $user_identity; ?></a>. <a href="http://www.hentaidreaming.com/wp-login.php?action=logout" title="<?php _e('Log out of this account') ?>">Logout »</a></p>
<?php else : ?>
<p>
<input type="text" name="author" id="author" value="<?php echo $comment_author; ?>" size="20" tabindex="1" />
<label for="author"><small>Name <?php if ($req) _e('<strong>(required)</strong>'); ?></small></label>
</p>
<p>
<input type="text" name="email" id="email" value="<?php echo $comment_author_email; ?>" size="20" tabindex="2" />
<label for="email"><small>Mail <?php if ($req) _e('<strong>(required, will not be published)</strong>'); ?></small></label>
</p>
<?php endif; ?>
<p>
<textarea name="comment" id="comment" tabindex="4" rows="10" cols="50" ></textarea>
</p>
<p>
<input name="submit" type="image" id="submit" class="input-submit" tabindex="5" value="Submit Comment" title="Please review your comment before submitting" alt="Submit Comment" src="http://www.hentaidreaming.com/wp-content/themes/hdreamwp/images/submit.gif" />
<input type="hidden" name="comment_post_ID" value="<?php echo $id; ?>" />
</p>
<?php do_action('comment_form', $post->ID); ?>
</form>
<?php endif; // If registration required and not logged in ?>
<?php endif; // if you delete this the sky will fall on your head ?>
</div> <!-- End "postinput" -->
</div> <!-- End "comments" -->
答案 0 :(得分:0)
paginate_comments_links()
这是你应该发布的内容,你发布的内容没有任何内容。