Jomments comment counter "comments (0)" not working

  • Anonymous
  • Topic Author
  • Visitor
  • Visitor
14 years 3 months ago #9171 by Anonymous
Hi,

I'm trying to figure how to implement the comment counter on the category layout for flexicontent. The one I'm talking about looks like this:

comments (24)

I want to put that next to the readmore on the category template but can't figure out how.

Thanks

Please Log in or Create an account to join the conversation.

  • Anonymous
  • Topic Author
  • Visitor
  • Visitor
14 years 3 months ago #9172 by Anonymous
Heres the code I have so far:
Code:
<?php if (file_exists(JPATH_SITE.DS.'components'.DS.'com_jcomments'.DS.'jcomments.php')) : require_once(JPATH_SITE.DS.'components'.DS.'com_jcomments'.DS.'jcomments.php'); $count = JComments::getCommentsCount($this->item->id, 'com_flexicontent'); echo $count ? ('Comments('. $count . ')') : 'Add comment'; endif; ?>

This code isn't working however. It doesn't pick up how many comments an item has.. it just displays "Add Comment" because it only sees 0 comments. Any ideas?

Please Log in or Create an account to join the conversation.

Moderators: vistamediajoomlacornerggppdk
Time to create page: 0.331 seconds
Save
Cookies user preferences
We use cookies to ensure you to get the best experience on our website. If you decline the use of cookies, this website may not function as expected.
Accept all
Decline all
Essential
These cookies are needed to make the website work correctly. You can not disable them.
Display
Accept
Analytics
Tools used to analyze the data to measure the effectiveness of a website and to understand how it works.
Google Analytics
Accept
Decline