简体   繁体   中英

Facebook “like” doesn't post on timeline

I want to have a "Like" Facebook button on my WordPress page. I tried using both plugins and straight code from the Facebook docs. Both work, but my "likes" don't publish on my timeline. I did put my AppID there, what can it be?

fb-root code:

<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/pl_PL/all.js#xfbml=1&appId=###"; fjs.parentNode.insertBefore(js, fjs); }(document, 'script', 'facebook-jssdk'));</script>`

fb:like code:

<fb:like href="<?php echo $_SERVER["HTTP_HOST"] . $_SERVER["REQUEST_URI"] ?>" send="true" width="450" show_faces="false"></fb:like>`

Check your Activity Log on Facebook to see if the 'Like' has shown up on your profile. The Like may have been posted as 'Recent Activity' or as a individual 'Someone has liked ...' post.

I would use the Facebook debugger to lint your site/page where the like button resides:

https://developers.facebook.com/tools/debug

This will tell you if you have any issues with the like button and or the OG tags on the page.

Hope this helps.

Here is the sample of your html should look like.

*Some Tip for you, dont simply like your page if you not sure your website format is correct, because it will submit a record to facebook with wrong title/images/description/content and etc.

 <html xmlns="http://www.w3.org/1999/xhtml"
  xmlns:og="http://ogp.me/ns#"
  xmlns:fb="https://www.facebook.com/2008/fbml">
 <head>
<title>WooTube</title>
<meta property="og:title" content="WooTube"/>
<meta property="og:type" content="website"/>
<meta property="og:url" content="http://www.wootube.woolei.com"/>
<meta property="og:image" content="http://i.ytimg.com/vi/LD-rmC2i624/default.jpg"/>
<meta property="og:site_name" content="WooTube"/>
<meta property="fb:admins" content="568394401"/>
<meta property="og:description"
      content="WooTube - Share Video To All Your FaceBook Group With 1 Click!"/>
 </head>
 <body>

You will need to submit your Facebook app for review before "likes" will appear in user's timelines, via Facebook's App Dashboard >> Status & Review >> Start a Submission:

https://developers.facebook.com/docs/apps/review

Probably I'm a bit late :) but given I don't see an accepted answer...

Are you able to see the right Like count from the FB Debugger ?

If not, probably worth to verify that the outcome of the following code represent the right URL (and with a proper encoding):

<fb:like href="<?php echo $_SERVER["HTTP_HOST"] . $_SERVER["REQUEST_URI"] ?>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM