custom share image for fb, g+ and twitter using open graph

倾然丶 夕夏残阳落幕 提交于 2019-12-13 07:37:05

问题


Is it possible to have a custom share image for Facebook, Google+ and Twitter?

I've already set up the open graph tags in the head of the document.

Thanks

UPDATE:

For Facebook:

<a href="http://www.facebook.com/share.php?u=url" target="_blank" ><img src="fb-img"/></a>

For Twitter:

<a href="http://twitter.com/home?status=<my-status>" target="_blank"><img src="twitter-img" /></a>

Still looking for google+

By the way, any difference with sharer.php v/s share.php for Facebook?


回答1:


I found the best solution to implement custom share button with Facebutton: Go to facebook developers page and there you will have to read the following article which will explain you how to use meta tags (HTML) on the head of your page: https://developers.facebook.com/docs/sharing/webmasters

Basically you need to add a Share Button on your page, right?. So, what you need to do is first of all, add the meta tags that page ask you for on the head of your page. Then everything is so easy. After facebook provides you with the code for the share button, now when you click on it, it will show you the image you specified on your meta tags. Take a look at that page and you'll see how easy is to implement it.

Twitter still i haven't implement it yet neither for google :(



来源:https://stackoverflow.com/questions/12559315/custom-share-image-for-fb-g-and-twitter-using-open-graph

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!