Why Facebook preview image is not showing up? - php

I have developed news page in my site and my client want to post the news from my site to
facebook and when he paste news link on the facebook, ideally it should create a facebook
post preview which load snapshot of news and also it populates image [if that page contains any image] in that snapshot.
I have searched on google and I found that I need use https://developers.facebook.com/tools/debug/ and I have used that facebook tool and I found that image is not grabbed while creating snapshot.
Now please someone tell me that what I can do to get image in preview of fb post.
Here is link which is having image in his content but still is not visible in preview.
this link is having image but when I this link on fb, it is not showing up image.
As news are get created automatically, I can add any meta tag because its static solution but I am using news feed which automatically creates new pages.
So I am not expecting any static solution

The reason you are not able to see an image preview is because there is no open graph object specified on that page. For example, you need to add this :
<meta property="og:image" content="http://bevforce.com/sites/default/files/2014-07-31%2003.59.57.jpg"> in your header.
More information about open graph object on Facebook documentation.

Related

Redirect image to specific page url from facebook timeline image using sharer.php

I am sharing image using to https://www.facebook.com/sharer/sharer.php?u=[some_image_link].png. When the user click the images in its facebook timeline it goes to the image path. I want to redirect the user to a particular page like http://www.example.com/page.php#/[some_image_link].
Can anyone please help?
You should be sharing a link with the OG meta tags that reflects the photo. Then you should be able to see if the request is coming from a crawler (see: https://developers.facebook.com/docs/sharing/webmasters/crawler) or a normal user and process the request accordingly.

Facebook share button shows thumbnail only after refresh. ZendFramework

im using Zend Framework v1, I have implemented the facebook share button on my site. If I click the share button for the first time, the data is fetched (title, description and URL) but not thumbnail. However if I refresh the page, come back and press again the button, the thumbnail is being displayed.
Same thing is when i post a link via fb website - at first time there is no thumbnail but after refreshing fb site and posting link again it is being displayed.
Does anyone know how to make it working?
The meta tags seems to be ok, the fb developer tool shows no errors.
Code in the ZF Controller
$this->view->doctype('XHTML1_RDFA');
$this->view->headMeta()->appendProperty('og:title', 'some value');
$this->view->headMeta()->appendProperty('og:type', 'website');
$this->view->headMeta()->appendProperty('og:url', 'http://mydomain/file?name='.$_GET["name"]);
$this->view->headMeta()->appendProperty('og:description', 'some value');
$this->view->headMeta()->appendProperty('og:image', 'http://mydomain/up/'.$_GET["name"]);
You can either trigger a first scrape via API when you publish a new piece of content, or specify the image dimensions via OG meta tags as well.
https://developers.facebook.com/docs/sharing/best-practices#precaching:
There are two ways to avoid this and have images render on the first Like or Share action:
Pre-cache the image with the URL Debugger
Use og:image:width and og:image:height Open Graph tags

Facebook share button, displaying old description text but a new image

I implemented the facebook share button on my web page, but it displays an old description text, I need to have a new text related to every article that I share, the image is updated as new.
Here is the link it's in arabic: http://achabakamagazine.com/new/articles.php?f=1&issueID=320&categoryID=26&articleID=9675&page=4
Make sure you follow Facebook sharing standards.
After that go to Facebook Url Debugger and check your each url stats.

Force facebook to show my prefered images of the site in status link update

Is there any way to control of the thumbnail of facebook status update when someone post a link of my website to their FB status? If yes, then can i make it dynamic depending on the link they share?
Yes and it is very easy, on each page simply add the meta tag "og:image" and set the path of your image, "og" stands for OpenGraph. Facebook Documentation
You can also find help on this blog and display a custom title, description, ...
You may also be interested that there is also specific meta tags for links published in Twitter. Twitter documentation.
For your information Facebook cache all the images, so if you change an existing image you may not directly see the new picture
When you are passing the image url pass the dynamic url so that when you alick on any post or page to share on facebook that will share the image of that page not the staic image you entered

Facebook does not show thumbnail when a photo is shared

I am using the following code to share images on facebook but when the dialog box is shown it does not show the image and once it is uploaded facebook just shows a link to image.
<a name="share" type="button" href="https://www.facebook.com/sharer.php?u=www.example.com/myimage" target="_blank">share</a>
This should work like this
<a href="http://www.facebook.com/sharer.php?s=100&p[title]=Our Site Title&p[url]=http://us.oursite.com/default.aspx&p[images][0]=http://www.history.malc.eu/globe.jpg&p[summary]=Our facebook description that is used on the FB share page." target="_blank">
Share this
</a>
EXAMPLE
Use the Facebook debug tool to see how Facebook processes the URL you're sharing.
The Facebook scraper will look for OpenGraph meta tags. You can reference the image you want as a thumbnail with the og:image and og:image:secure_url
Alternatively, if you wanted to upload the image to Facebook so that it goes into the user's album, you should check out How-To: Use the Graph API to Upload Photos to a User's Profile
To be more clear, you should not be sharing a link directly to the image, but rather to a page which has OpenGraph meta tags, one of which should link to the image.
Facebook doesn't support sharing of plain images, only hyperlinks can be shared. Try posting the same image's link on your profile as status. Facebook won't show you any thumbnail for it but just the link. To share a image on facebook, you have to somehow upload it -_-
From the social plugins docs the share initiates a callback from Facebook to the page you want to share. To affect what that shows you would have a page with meta tags (og:image, og:title and og:description) to affect what Facebook puts in the comment on the users timeline.
To show the image, you'd probably need a hosting 'page' that uses a thumbnail of your image in its meta data so that it appears in the users timeline correctly.
Facebook then polls this periodically. This is very similar to the like mechanism.
Make sure you use dont click on share more than once, after that you cant see additional changed you made for next 24 hours

Categories