Search
Close
AI Search
Classic Search
 Search Phrase:
 Search Type:
Advanced search options
 Search in Forums:
 Search in date period:

 Sort Search Results by:

AI Assistant
Notifications
Clear all

wpDiscuz show a comment counter?

1 Posts
1 Users
0 Reactions
3,428 Views
(@spontis)
Trusted Member
Joined: 9 years ago
Posts: 50
Topic starter
Translate
English
Spanish
French
German
Italian
Portuguese
Russian
Chinese
Japanese
Korean
Arabic
Hindi
Dutch
Polish
Turkish
Vietnamese
Thai
Swedish
Danish
Finnish
Norwegian
Czech
Hungarian
Romanian
Greek
Hebrew
Indonesian
Malay
Ukrainian
Bulgarian
Croatian
Slovak
Slovenian
Serbian
Lithuanian
Latvian
Estonian
  [#1737]

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