Pagination Comments Doesn’t Show

what im trying to accomplish is adding a pagination to my function for comments. I think im on the right track with my code but I need some guidance.

<?php $comments = get_comments('number=24&amp;amp;status=approve');
$true_comment_count = 0;
foreach($comments as $comment) :
?>

<?php $comment_id = get_comment(get_comment_ID())->user_id; ?>
<?php $comment_type = get_comment_type(); ?>
<?php if($comment_type == 'comment') { ?>
<?php $true_comment_count = $true_comment_count +1; ?>
<?php $comm_title = get_the_title($comment->comment_post_ID);?>
<?php $comm_link = get_comment_link($comment->comment_ID);?>
<?php $comm_comm_temp = get_comment($comment->comment_ID,ARRAY_A);?>
<?php $comm_content = $comm_comm_temp['comment_content'];?>

<li>

<span class="footer_comm_author">
<img width="170" height="150" class=" avatar user-<?php echo $comment_id ?>-avatar" alt="" src="http://deafcube.com/wp-content/plugins/user-avatar/user-avatar-pic.php?id=<?php echo $comment_id ?>">

<div class="comment-text"><a href="<?php echo($comm_link)?>" title="<?php comment_excerpt(); ?>"><?php echo($comment->comment_author)?></span> on 
<?php echo $comm_title?></a></div>

</li> 

<?php } ?>
<?php if($true_comment_count == 24) {break;} ?>
<?php endforeach;?>

<div id="pagination-comments"><?php paginate_comments_links($true_comment_count); ?></div>

THANK YOU ALL!

Related posts

Leave a Reply

1 comment

  1. I don’t think you’re passing arguments correctly to paginate_comments_links(). The function is basically a wrapper for paginate_links(), and accepts the same array of arguments.

    Here are the defaults:

    <?php 
        $args = array(
            'base'         => '%_%',
            'format'       => '?page=%#%',
            'total'        => 1,
            'current'      => 0,
            'show_all'     => False,
            'end_size'     => 1,
            'mid_size'     => 2,
            'prev_next'    => True,
            'prev_text'    => __('&laquo; Previous'),
            'next_text'    => __('Next &raquo;'),
            'type'         => 'plain',
            'add_args'     => False,
            'add_fragment' =>  ''
        ); 
    ?>
    

    Here’s how I use it:

    <?php paginate_comments_links( array( 'prev_text' => '&lt;&lt;', 'next_text' => '&gt;&gt;' ) ); ?>
    

    So, what arguments are you trying to pass to the function?