dongtuoleng8624 2017-04-03 08:29
浏览 41
已采纳

在移动和桌面网站之间同步Facebook评论

I have 2 versions of my website Mobile and Desktop with Facebook Comment Plugin embedded in it. I want to sync every comment between the 2 websites having same address except for the subdomain like

https://www.example.com/contact-us.php
https://m.example.com/contact-us.php

I read about Comment Mirroring at Facebook Comments - Synchronization between website and fan page but I don't think this is what I want.

I want to enable my visitors to comment and see same comments on both these versions. Is it possible or not? I mean if someone comment on desktop version website then the comment should be visible on mobile version as well.

I have this code provided by Facebook when embedding Comment Plugin. Where do I have to change to support comment sync

 <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/en_US/sdk.js#xfbml=1&version=v2.6&appId=XXXXXXXXXXXXXXXX";
 fjs.parentNode.insertBefore(js, fjs);
 }(document, \'script\', \'facebook-jssdk\'));</script>

And this code on the page I want to show comment block

 <div class="fb-comments" data-href="https://www.example.com/contact-us.php" data-width="950" data-numposts="5"></div>
  • 写回答

1条回答 默认 最新

  • dongyoudi1342 2017-07-13 12:24
    关注

    The comments made via the comments plugin are not tied to the page that you embed the plugin on, but to the URL you specify in the data-href parameter.

    So if you want to have the same comments on the desktop and the mobile version of your site - specify one of those URLs as data-href for both versions.


    Also, you should use the same og:url value for both versions; otherwise, like and share counts will get split over those two distinct URLs.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 运动想象脑电信号数据集.vhdr
  • ¥15 三因素重复测量数据R语句编写,不存在交互作用
  • ¥15 微信会员卡等级和折扣规则
  • ¥15 微信公众平台自制会员卡可以通过收款码收款码收款进行自动积分吗
  • ¥15 随身WiFi网络灯亮但是没有网络,如何解决?
  • ¥15 gdf格式的脑电数据如何处理matlab
  • ¥20 重新写的代码替换了之后运行hbuliderx就这样了
  • ¥100 监控抖音用户作品更新可以微信公众号提醒
  • ¥15 UE5 如何可以不渲染HDRIBackdrop背景
  • ¥70 2048小游戏毕设项目