Notifications
Clear all

wpDiscuz show a comment counter?

1 Posts
1 Users
0 Reactions
2,660 Views
(@spontis)
Trusted Member
Joined: 7 years ago
Posts: 44
Topic starter  

In my old Theme, i've coded a simple comment count to show ongoing numbering right to the comment. My Implementation via functions.php doesn't work anymore, becaus wpdiscuz display the comments in his own way.

Is there a possibility to show a ongoing comment count inside each comment? (e.g. "#1, #2, #3, ...) Here is the Code Example from my Old Comment-Template and the functions.php:

function ping_count( $count ) { 
global $id;
$comments_by_type = &separate_comments(get_comments('post_id=' . $id));
return count($comments_by_type['pings']);
}
function comment_count( $count ) {
global $id;
$comments_by_type = &separate_comments(get_comments('post_id=' . $id));
return count($comments_by_type['comment']);
}
add_filter('get_comments_number', 'comment_count', 0);

And the display that in the comment-template, located also in the functions.php:

<div class="comment-number"> 
<a class="permalink" href="<?php echo htmlspecialchars( get_comment_link( $comment->comment_ID ) ) ?>"><?php $comment_number++; echo $comment_number; ?></a>
</div>

I hope, you'll undestand my question 🙂


   
Quote
Share:
Scroll to top