5

We are using the http://developers.facebook.com/docs/reference/plugins/comments/ Plugin for the comments on our website.

The comments the tool displays are sorted by the social "factor", i.e. much liked comments first etc.

I want to show the newest comments first, reverse chronological. I have no idea how to set this as the default for all our visitors.

I have found some ideas here: Facebook comments plugin - how to sort comments? Setting Facebook comments web plugin

However, noting of this seems to work anymore.

Do you have any idea what to do?

Community
  • 1
  • 1
Tes Taccount
  • 51
  • 1
  • 1
  • 3

3 Answers3

9

I have seen a lot of answers to this, but only this one worked for me.

<div class="fb-comments" data-href="your-website" data-num-posts="5" data-width="638" data-order-by="reverse_time"></div>

So anyway the key thing to set is data-order-by="reverse_time".

Nemanja
  • 151
  • 2
  • 4
1

Well I did some research and found a solution that worked for me:

First of all, I took the generated code from Facebook, which you can get on: facebook comment plugin

Example:

<div id="fb-root"></div>
<script>(function(d, s, id) {
var js, fjs = d.getElementsByTagName(s)[0];
if (d.getElementById(id)) return;
js = d.createElement(s); js.id = id;
js.src = "//connect.facebook.net/de_DE/all.js#xfbml=1";
fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));</script>

I put the div at the top of the body on the side I want the plugin to appear. You can put the script in the head or in an external JS-File.

After that, I put the 2nd part of the generated code in the place I want the Comments-Plugin to appear.

Example:

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

Now the most important part: I then put another data-Attribute into the div with the class fb-comments:

data-sort-by="reverse_time"

Which makes the comments appear in a reverse chronological order!

Hope I helped!

bool.dev
  • 17,508
  • 5
  • 69
  • 93
0

Ok both a responsive design and sorted fb comments here:

in html file:

<div class="fb-comments" data-href="http://www.yourpage.org/" data-numposts="20" data-width="100%" data-order-by="reverse_time" data-colorscheme="light"></div>

in CSS file:

.fb-comments {
  min-width: 100% !important;
  width: 100% !important;
}