I'm trying to add komento comments count add to article at below file
templates/name-template/html/com_content/article/default.php
code
$query->select(' COUNT(jc.id) AS comments_count, MAX(jc.created) AS comments_date')
->join('LEFT', '#__komento_comments AS jc ON jc.cid = a.id AND jc.component = \'com_content\' AND jc.published = 1');
and use this code for fetch
<?php echo $this->item->comments_count; ?>
but not show comments count ad get error
i
so that nobody else will need to clean up your post. I upvote clear, on-topic questions that don't need editing.from()
call?$this->item
doesn't fetch query results. Do you also need to extract the most recent date?$comments_link
relevant to your question? If not, please remove it. Looks like you don't need a JOIN. Do you mean to use FROM instead?