• Hi

    I have set my comments per page to 10 top level in my discussion admin area but my comments template is somehow not hooking into comments_per_page

    I’ve been using veryplaintxt as the basis for my theme but have been developing over the top of it. Can anyone help me work out what’s missing on my following code? The pagination links are activated and working but all of the comments are showing on all of the paginated pages rather than 10 at a time.

    ` <!– start comment loop –>
    <?php if ( $comments ) : ?>
    <?php global $veryplaintxt_comment_alt ?>
    <?php
    $ping_count = $comment_count = 0;
    foreach ( $comments as $comment )
    get_comment_type() == “comment” ? ++$comment_count : ++$ping_count;
    ?>
    <?php if ( $comment_count ) : ?>
    <?php $veryplaintxt_comment_alt = 0 ?>
    <h2 class=”comment-header” id=”numcomments”>
    <?php printf(__($comment_count > 1 ? ‘%d Memories’ : ‘One Memory’, ‘veryplaintxt’), $comment_count) ?>
    </h2>

    <ul id=”comments” class=”commentlist”>
    <?php foreach (array_reverse($comments) as $comment) : ?>
    <?php if ( get_comment_type() == “comment” ) : ?>
    <li id=”comment-<?php comment_ID() ?>” class=”<?php veryplaintxt_comment_class() ?>”>
    <div class=”comment-author vcard”>
    <?php veryplaintxt_commenter_link() ?>
    </div>
    <?php if ($comment->comment_approved == ‘0’) : ?>
    <div class=”unapproved”>
    <?php _e(‘<p>Thank you for sharing a memory of the ballet. It will be on the site soon.</p>’, ‘veryplaintxt’) ?>
    <?php include (‘share.php’); ?>
    </div>
    <?php endif; ?>
    <?php comment_text() ?>
    <div class=”comment-meta”>
    <?php edit_comment_link(__(‘Edit’, ‘veryplaintxt’), ‘<span class=”comment-edit”> | ‘, ‘</span>’); ?>
    </div>
    </li>
    <?php endif; ?><!– //end get comment type–>
    <?php endforeach; ?>
    </ul>

    <div class=”navigation”>

    <?php $veryplaintxt_comment_alt = 0 ?>

    <p class=”comment_page_numbers”> <?php paginate_comments_links(‘prev_text=&next_text=’); ?></p>
    </div><?php endif ?><!– //end comment count –>
    <?php endif ?><!– //end of comment loop –> `

  • The topic ‘comments_per_page not working’ is closed to new replies.