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.
When the 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:
Configuration settings
data-page-id
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 mentioned in the frontend configuration page.
data-custom-text
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.