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;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!
I don’t think you’re passing arguments correctly to
paginate_comments_links()
. The function is basically a wrapper forpaginate_links()
, and accepts the same array of arguments.Here are the defaults:
Here’s how I use it:
So, what arguments are you trying to pass to the function?