Help get this topic noticed by sharing it on Twitter, Facebook, or email.

How can I get a unique comments code for each page of my site?

How can I change the custom code so that I can have many comments sections on different pages that are unique from each other? I mean every time I create a new page and want a comments section for it, how can I use a code that will recognize that page as a new page and give me a fresh and empty comments section?

I want to run a blog with a front page that has snippets of articles with a "continue reading" and the "comments (#)" button at the bottom of each snippet. Then when the user click continue reading or the comments link they are taken to the page where the comments are. In addition to the problem I stated above, I'm having trouble putting the "comments counter" link on a different page and still have it show the comments count in another page.

Any help would be tremendously appreciated.
1 person has
this question
+1
Reply
  • Some of the example sites on the front page like komonews.com have exactly what I am desperately seeking. They have a unique comments section for each of their pages. And they show the comments count on those sections in their frontpage. It looks like this would be a common and plausible problem for a lot of people but I can't find anything in the FAQs or any full responses to past questions on this forum.

    Again, I would be grateful for any help.
  • (some HTML allowed)
    How does this make you feel?
    Add Image
    I'm

    e.g. kidding, amused, unsure, silly indifferent, undecided, unconcerned happy, confident, thankful, excited sad, anxious, confused, frustrated

  • Hi there - normally, your pages are identified by their unique URL, or if you're using something like WordPress to manage your website, then it has a specific, unique identifier used internally to reference each post/page. If you're doing this manually, then you can also allocate a unique number to each post to help with this process and make sure that pages are always identified correctly. The default generic codes should look something like this:



    If you want to specify a custom value to make these more portable, then you should change the line with idcomments_post_id to be something like:

    var idcomments_post_id = 1;

    and then you can change that number for each one. Just make sure you're always using numbers that correspond to the same post/page, whether you're loading the comments area, or a comment link for that particular page.

    Hope that helps,
    Beau
  • (some HTML allowed)
    How does this make you feel?
    Add Image
    I'm

    e.g. kidding, amused, unsure, silly indifferent, undecided, unconcerned happy, confident, thankful, excited sad, anxious, confused, frustrated

  • I actually didn't realize the code used the URL to ID the comments. Thank you so much for the heads up! Only thing is, how do I change the code so I can put the "comments" button on a page with a different URL?

    Thanks again for the great help!
  • (some HTML allowed)
    How does this make you feel?
    Add Image
    I'm

    e.g. kidding, amused, unsure, silly indifferent, undecided, unconcerned happy, confident, thankful, excited sad, anxious, confused, frustrated