简体   繁体   中英

How do I get Facebook Like button to show the link and not just say “Jim likes a link” on a Wordpress post?

In the text view of a WordPress post, I pasted this code:

<iframe src="//www.facebook.com/plugins/like.php?   href=https://thebarneyreview.com&amp;width&amp;layout=standard&amp;action=like&amp;show_faces=true&amp;share=true&amp;height=80" scrolling="no" frameborder="0" style="border:none; overflow:hidden; height:80px;" allowTransparency="true"></iframe>

When I click on the Share button, it works fine. It posts a link and preview of website you are sharing.

When I click the Like button, it just shows up in my Facebook activity log as "Jim likes a link" instead of "Jim likes thebarneyreview.com" or something that shows what I'm liking. And it doesn't show up in anybody's newsfeed. Is there something I need to change in the code or am I wrong about how the Like button should work?

On scraping your url using the debugger , I can see that the Open Graph meta tags are missing from your page. It seems like you need to add these tags to alter how your story renders. eg if you set the og:type to article , the story will render as ' Foobar likes an article on ... '. You can look at the docs about the Open Graph meta tags here and here .

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