Hi I am currently using the latest version – 7.2.2 and total comments number is not updating. We can check if it actually does by the following test code running early as the DOM ready –
$('.wpd-thread-info > span.wpdtc').text('...');
It will remove the total comments no. and watch to see if the post ajax comments loading also update the number.
Since it’s not working for me, I have to write the following codes in my script file within my themes to make it work –
// Options for the observer
const config = { attributes: false, childList: true, subtree: true },
commentNode = document.querySelector('#wpd-threads > .wpd-thread-list'),
// Create an observer instance
observer = new MutationObserver(function(mutationsList, observer) {
//observe only once
this.disconnect();
setTimeout(() => {
let comments = $('.wpd-thread-list .wpd-comment-author').length;
$('.wpd-thread-list .wpd-view-replies').each((i, replyComment) => {
const r = $(replyComment).text().match(/\d/);
if ( r.length )
comments += parseInt(r[0]);
});
$('.wpd-thread-info').attr('data-comments-count', comments)
.find('> span.wpdtc').attr('title', comments).text(comments);
}, 1000);
});
// Start observing the comment node when available
if ( commentNode ) {
$('.wpd-thread-info > span.wpdtc').text('...');
observer.observe(commentNode, config);
}
I hope this will help out anyone looking for the same issue…
thanks,
biswa!