Reputation: 32912
The default sorting order of the facebook comments plugin is by social status. How do I set the default order to reverse chronological on my web page?
I know there is an option on the top of the plugin. But not all users know about it and the sorting order is confusing.
Upvotes: 12
Views: 7982
Reputation: 24043
If you visit https://developers.facebook.com/tools/comments/{Your_app_id}/ and then click the Settings link, it will let you edit the "Sort Comments By" setting.
The choices are:
According to https://developers.facebook.com/docs/plugins/comments/#moderation-setup-instructions, your webpage must have a tag like <meta property="fb:app_id" content="{YOUR_APP_ID}" />
.
P.S. Unfortunately for me, since I'm using ClickFunnels, adding this tag doesn't seem to have any effect. I would instead need to be in complete control of my webpage (and not use a simplified tool like ClickFunnels).
Upvotes: 0
Reputation: 32912
I was googling a lot without success, so I solved this by some reverse engeneering...
facebook_crazy_url
of that iframe (see step 2). The inserted iframe seems to be the only thing that is needed to run the comments properlyfacebook_crazy_url
&order_by=reverse_time"Upvotes: 14
Reputation: 3100
Another option inspired by Jan Turoň's solution:
<div id="comments"><fb:comments ...></fb:comments></div>
$('#comments iframe').attr('src', $('#comments iframe').attr('src') + '&order_by=reverse_time')
Of course, you can do this without jQuery.
It loads the comments' frame twice, but it works in all cases without harcoding the iframe's src.
Upvotes: 3
Reputation: 842
Just guessing I added
data-order-by="reverse_time"
to the div provided by Facebook and it worked nicely. So, loading the pluging with the standard html5 code provided here: https://developers.facebook.com/docs/reference/plugins/comments/
just add the data-order-by
attribute like this:
<div class="fb-comments" data-href="YOUR_URL" data-width="470" data-num-posts="6" data-order-by="reverse_time"></div>
Upvotes: 2
Reputation: 441
You cannot change the default sort order of the comments plugin. To achieve something like this, you could retrieve the comments yourself, e.g., using FQL, but then you need to build everything else, too. Or use something like Disqus.
Upvotes: 2