WordPress.org

Support

Support » How-To and Troubleshooting » [Resolved] Customized comments pagination

[Resolved] Customized comments pagination

  • retroriff
    Participant

    @retroriff

    Hello,

    I’ve configured my WPMU 2.9 in order to paginate comments. It works when I use the comments.php template included on the default Kubrick theme. The function <?php wp_list_comments(); ?> displays paged comments correctly.

    I need to customize my comments without <?php wp_list_comments(); ?> and I don’t get it work. The paged comments navigation code works:

    <?php if(get_comments_number() > get_option('comments_per_page')) : ?>
    <?php paginate_comments_links(); ?>
    <?php endif; ?>

    However comments.php is displaying all my comments on each paged comments page. I guess I must add some boundaries before <?php foreach ($comments as $comment) : ?>

    This is a summary of my code:

    <?php if ( have_comments() ) : ?>
        <?php foreach ($comments as $comment) : ?>
        <?php comment_text() ?>
        <?php endforeach; ?>
    <?php endif; ?>

    But it displays all comments instead of X per page. Does anyone know how to display the right comments amount?

    Thank you

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘[Resolved] Customized comments pagination’ is closed to new replies.