How do I remove a facebook comment warning?

后端 未结 4 1491
时光取名叫无心
时光取名叫无心 2021-01-22 15:03

my fb comments code is:

\" width=\"600\"  xid=\"\" notify=\"true\"  candelete=\"true\" si         


        
相关标签:
4条回答
  • 2021-01-22 15:48

    Instead of <fb:comments ..., I used <div class="fb-comments" ... and then everything worked correctly.

    0 讨论(0)
  • 2021-01-22 15:49

    @gil-goldshlager, thanks for this workaround, I think a lot of developers are looking for this. I myself are struggling with this since a long time on one of my sites: sharemovi.es

    I think most important thing you managed is to show old vs new comments side by side.

    Unfortunately the yellow box still shows up in some instances, and some comments get lost consequently :

    1. OK: post after 12.15.2011 without comments (http://sharemovi.es/theprestige)

    2. OK: both post + comments after 12.15.2011 (http://sharemovi.es/biutiful)

    3. OK: both post + comments before 12.15.2011 (http://sharemovi.es/thesocialnetwork, http://sharemovi.es/battlelosangeles and http://sharemovi.es/thequickandthedead) - really nice to see those comments back!

    4. not OK: posts before 12.15.2011 without comments - 2 problems here:

    a. yellow box with "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."

    b. the comments for those posts/pages that were made AFTER 12.15.2011 disappear (without comments: http://sharemovi.es/fromdusktilldawn, http://sharemovi.es/waiting, with comments - I checked moderation panel - http://sharemovi.es/ellesappelaitsarah and http://sharemovi.es/thegame )

    All together, I get more comments now than before, so thanks again. However the yellow box is quite ugly, doesn't look professional. Very bad design decision from Facebook!

    Hopefully you can look into this, I am happy to assist where possible.

    Cheers Bob

    0 讨论(0)
  • 2021-01-22 15:55

    https://developers.facebook.com/docs/reference/plugins/comments/

    Put your website URL, set the number of posts that you want to have in comments, get the code. First part put it in header, right after <body> and the <div> in single.php (single post template). Delete </div><?php comments_template(); ?></div> and add the one from facebook ;) Works perfect for me ;)

    0 讨论(0)
  • 2021-01-22 15:57

    I wrote a complete tutorial with a small use of JS to solve this issue. Visit the tutorial


    What I did was:

    • Set off the parse for XFBML tags in the JS SDK
    • Adding a function-call to the JS SDK with a date parameter that you manually set it once with a date that posts published after that date will start using the 'href' version, and posts published until that date will use the migrated version.
    • Adding another attribute to the fb:comments tag which is 'data-date' and in it's value you place your post date (dynamic code).
    • Calculating the dates in a JS code, and base on the result it's removing the not wanted attributes, and finally then it's render the XFBML tags using FB.XFBML.parse
    0 讨论(0)
提交回复
热议问题