Setting Facebook comments web plugin

后端 未结 5 1283
南笙
南笙 2020-12-31 09:29

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?

5条回答
  •  傲寒
    傲寒 (楼主)
    2020-12-31 09:55

    Another option inspired by Jan Turoň's solution:

    1. put your fb:comments in a div with id "comments":
        
    1. use jQuery to change the generated iframe's src:
        $('#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.

提交回复
热议问题