Same Facebook Comments Plugin Across Site

Permalink
So I've added the Facebook comments plugin to my site and it is all working perfectly except for the comments are the same across the entire site. eg: if someone comments on the homepage, the comments show up on blog posts and everywhere the block is.

I need a function that generates the current page to stick in the data-href of the fb comments code I'm pretty sure.

Here's and example of the plugins code:

<div class="fb-comments" data-href="http://example.com" data-num-posts="2" data-width="470"></div>

Thanks in advance for any help.

Th0ma5B
 
alphus replied on at Permalink Reply
I just found the answer to this so thought I'd share it, although it'sa little late!

Simply remove the data-ref tag thus:

<div class="fb-comments" data-num-posts="2" data-width="470"></div>

or put the value as nothing, thus, I think these are both the same:

<div class="fb-comments" data-href="" data-num-posts="2" data-width="470"></div>

Comments will link back to the specific page and if the code is on a template rather than specific page code, different comments will apear on different pages
Th0ma5B replied on at Permalink Reply
Th0ma5B
Yes I initially found this solution and at first it accomplishes the goal of having comments related to only that page.

But for me, and others on a Google search, it causes a format warning in a yellow box below the comment thread saying

" Warning: this comments plugin is operating in compatibility mode, but has no posts yet. Consider specifying an explicit 'href' as suggested in the comments plugin documentation to take advantage of all plugin features. "

In my head the best solution around this would be to echo the entire href line in the header.php with a "currentURL" type of variable inside that.

For now I've just got the Facebook html data-href="" blank, so it's one extra step copying the page URL into each page. It works for now with only a few posts a month, but I'm leaving for Europe in 3 weeks which the blog was designed for so it'd be a good step to eliminate.
enlil replied on at Permalink Reply
enlil
I wrote a how-to to accomplish this using the Magic Data add-on:

http://www.concrete5.org/documentation/how-tos/designers/integrate-...
enlil replied on at Permalink Reply
enlil
My Enlil Facebook Plugins package can now handle all of this with ease. You can even set it to produce individual comments boxes on profile pages from within the edit dialogue. It contains an array of blocks to get the most from users interacting with your site using Facebook!