• Resolved ocade

    (@ocade)


    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.
    • This topic was modified 6 years ago by ocade.
Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter ocade

    (@ocade)

    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

    (@ocade)

    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.