By Mist on Thursday, 08 October 2015
Posted in General Issues
Replies 3
Likes 0
Views 512
Votes 0
Hi guys,
How can i retrieve the comments count using the foundry api, for an article ID ?

Basically, i am using ES Comments with Joomla articles and i just want to show the comments count for each article, in various views.

I have the article ID .... and just need to output the ES comments count for it.

Thanks in advance !
Hi Mist,

You can try to use getCount method in order to retrieve total number of comment of the article. Example as follow:
$comments = FD::comments($article->id, 'article', 'create', SOCIAL_APPS_GROUP_USER, array('url' => $url));
echo $comments->getCount();
·
Thursday, 08 October 2015 17:44
·
0 Likes
·
0 Votes
·
0 Comments
·
Great, it's working ! Thanks Ezrul !
·
Thursday, 15 October 2015 00:47
·
0 Likes
·
0 Votes
·
0 Comments
·
Thanks for updating, glad that your issues are resolved now
·
Thursday, 15 October 2015 01:53
·
0 Likes
·
0 Votes
·
0 Comments
·
View Full Post