Page 1 of 1

jcomment comment ticket. Number of comments

Posted: Wed Feb 12, 2020 7:03 pm
by rrrccc
News Show I want to show the number of comments with the jcomment link in the SP2 news module. K2 also works. jcomment (0) appears. I made changes to the default.php file. I was not successful Can you help? Thank you

I must make changes to the attached files. Can anyone understand me help me?
In which file should I upload these codes?

$commentsAPI = JPATH_SITE . '/components/com_jcomments/jcomments.php';
if (file_exists($commentsAPI)) :
$total = JComments::getCommentsCount($this->item->id, 'com_content');
echo '<a href="' . JRoute::_(ContentHelperRoute::getArticleRoute($this->item->slug, $this->item->catid)). '#comments">' . $total . ' ' . JTEXT::_('TOTAL_COMMENTS'). '</a>';