Title: Shown comments count is wrong
Last modified: June 3, 2020

---

# Shown comments count is wrong

 *  Resolved [ocade](https://wordpress.org/support/users/ocade/)
 * (@ocade)
 * [6 years ago](https://wordpress.org/support/topic/shown-comments-count-is-wrong/)
 * Hello,
 * in our Intranet page, I’m using uLike for posts since a while without any issue.
   Today, I just added the uLike feature to comments too by using the following 
   shortcode:
 * `do_shortcode('[wp_ulike for="comment" id="' . $comment->comment_ID . '"]')`
 * Well, the uLike button is shown. But I have the following unexpected result and
   I was not able to find another thread etc. mentioning the same issue:
 * – I have a comment with 0 likes.
    – If I like the comment, the counter switches
   from 0 to 2 (looking in the database in _wp\_ulike\_comments_, I can find only
   one like) – If I reload the page, the like icon is highlighted (the red thumb),
   but there is shown a 0 count – If I revoke my like by pressing the like button
   again, the counter switches from 0 to 1 (not OK) and the like icon is no longer
   highlighted (grey thumb) (OK) (looking in the database, the record is set to 
   status unlike)
 * WordPress Version 5.4.1
    Plugin Version 4.2.2
 * Do you have any idea what might be the reason?
 * Regards
    -  This topic was modified 6 years ago by [ocade](https://wordpress.org/support/users/ocade/).
    -  This topic was modified 6 years ago by [ocade](https://wordpress.org/support/users/ocade/).

Viewing 2 replies - 1 through 2 (of 2 total)

 *  Thread Starter [ocade](https://wordpress.org/support/users/ocade/)
 * (@ocade)
 * [6 years ago](https://wordpress.org/support/topic/shown-comments-count-is-wrong/#post-12934300)
 * Update from my side:
 * I just made additional tests and in a clean installation, it is working fine.
   So I continued the debugging.
 * If I enable the option “Automatic display”, it’s working fine as expected. So
   the counting issues only occurs when not using the automatic display and using
   a callback function with the function _wp\_list\_comments_:
 * `<?php wp_list_comments( 'type=comment&callback=bi_posts_get_comments' ); ?>`
 * In the callback function, I’m let returning:
 * `do_shortcode('[wp_ulike for="comment" id="' . $comment->comment_ID . '"]')`
 * Any idea about the reason?
 *  Thread Starter [ocade](https://wordpress.org/support/users/ocade/)
 * (@ocade)
 * [6 years ago](https://wordpress.org/support/topic/shown-comments-count-is-wrong/#post-12936754)
 * Hello,
 * issue solved. The reason was in the callback function as the uLike-Shortcode 
   was executed within <article> tags. With removal, it’s working fine.
 * Regards

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Shown comments count is wrong’ is closed to new replies.

 * ![](https://ps.w.org/wp-ulike/assets/icon.svg?rev=2453069)
 * [WP ULike – Like & Dislike Buttons for Engagement and Feedback](https://wordpress.org/plugins/wp-ulike/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/wp-ulike/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/wp-ulike/)
 * [Active Topics](https://wordpress.org/support/plugin/wp-ulike/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wp-ulike/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wp-ulike/reviews/)

 * 2 replies
 * 1 participant
 * Last reply from: [ocade](https://wordpress.org/support/users/ocade/)
 * Last activity: [6 years ago](https://wordpress.org/support/topic/shown-comments-count-is-wrong/#post-12936754)
 * Status: resolved