When using Facebook Sharer, Facebook will offer the user the option of using 1 of a few images pulled from the source as a preview for their link. How are these images selected, and how can I ensure that any particular image on my page is always included in this list?
相关问题
- facebook error invalid key hash for some devices
- LoginActivty with Firebase & Facebook authenticati
- facebook “could not retrieve data from URL”
- setRequestHeader Content-Type causes POST request
- Sharing to Facebook Stories
相关文章
- Facebook login for group members
- The method FB.api will stop working when called fr
- React native deep linking vs Facebook SDK conflct
- UIActivity with no settings for Facebook
- facebook send API Error Code: 100 API Error Descri
- Can't use Facebook Account Kit: Error inflatin
- Facebook API error subcode 33
- Devise + Omniauth: undefined method `user_omniauth
As of 2013, if you're using facebook.com/sharer.php (PHP) you can simply make any button/link like:
Link query parameters:
It's plain simple: you do not need any js or other settings. Is just an HTML raw link. Style the A tag in any way you want to.
From my experience, the http://www.facebook.com/sharer.php does not use meta tags. It uses the string you pass. See below.
http://www.facebook.com/sharer.php?s=100&p[title]=THIS IS MY TITLE&p[summary]=THIS IS MY SUMMARY&p[url]=http://www.MYURL.com&&p[images][0]=http://www.MYURL.com/img/IMAGEADDRESS
The meta tags work with Facebook's developer like/send buttons, as does the other Open Graph info. So if you use one of Facebook's actual elements like the comments and such, that will all tie into the Open Graph stuff.
UPDATE: There are two ways to use the sharer * note the ?s versus the ?u value in the query string
1 ==> STRING: http://www.facebook.com/sharer.php?s + content from above
~~> Will pull info from the string.
2 ==> URL: http://www.facebook.com/sharer.php?u=url where url equals an actual url
~~> Will scrape the page provided in the url value
~~> You can test test the values here: https://developers.facebook.com/tools/debug
Put the following tag in the
head
:From http://www.facebook.com/share_partners.php
As far as what it chooses as the default in the absence of this tag, I'm not sure.
When you share for Facebook, you have to add in your html into the head section next meta tags:
And that's it!
Add the button as you should according to what FB tells you.
All the info you need is in www.facebook.com/share/
I couldn't get Facebook to pick the right image from a specific post, so I did what's outlined on this page:
https://webapps.stackexchange.com/questions/18468/adding-meta-tags-to-individual-blogger-posts
In other words, something like this:
Basically, you're going to hard code an if statement into your site's HTML to get it to change the meta content for whatever you've changed for that one post. It's a messy solution, but it works.
Old way, no longer works:
Reported new way, also does not work:
It randomly worked off and on during the first day I implemented it, hasn't worked at all since.
The Facebook linter page, a utility that inspects your page, reports that everything is correct and does display the thumbnail I selected... just that the share.php page itself doesn't seem to be functioning. Has to be a bug over at Facebook, one they apparently don't care to fix as every bug report regarding this issue I've seen in their system all say resolved or fixed.