Wordpress комментарии, нумерация страниц - PullRequest
0 голосов
/ 25 декабря 2010

Вот пост с 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 &raquo;</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" -->

1 Ответ

0 голосов
/ 25 декабря 2010
paginate_comments_links()

Это то, что вы должны были опубликовать, то, что вы опубликовали, ничего не говорит.

...