You can display a count of the number of comments next to each article in your website with Commento's count.js feature. To do this, simply include the following snippet in your HTML:

<script src=""></script>

On pages where you want to display comment counts, append a #commento to the end of the href attribute of links should display the number of comments. Commento will automatically look for such links and fill them with the number of comments. For example, consider the following link.

<a href=""></a>

When the count.js snippet is included, Commento would automatically search for all such links ending with #commento and fill the inner text with the number of comments, like so:

<a href="">12 comments</a>

Configuration settings


When this attribute is set on the <a> tag, its value will be used as the identifier when fetching the number of comments. Must be identical to the data-page-id mentioned in the frontend configuration page.


When this attribute is set on the <script> tag, its value will be evaluated using JavaScript's eval function. The return value will be called to set a custom text. For example, consider the example snippet below.

<a href=""></a>
window.commentCustomText = function(count) {
  if(count === 0) {
    return "No comments";
  } else if (count === 1) {
    return "1 comment";
  } else {
    return count + " comments";
<script src="" data-custom-text="window.commentoCustomText"></script>

results matching ""

    No results matching ""