Open Graph tag for Whatsapp link sharing

本秂侑毒 提交于 2021-01-29 11:38:59

问题


I use Open Graph tags for sharing on social media. My image is 1200 x 630 pixels and works on Facebook and Whatsapp:

<meta property="og:image" content="https://emotionathletes.org/images/logo_1200x630_facebook_shared_image_EN.png">

On Facebook, the image appears OK, since it's made for it. On Whatsapp, the appears cropped, since seems to expect a square image.

Can I use a tag to provide an image for sharing only on Whatsapp?


回答1:


You can specify two (or more) Open Graph images, the first, rectangular image for FB and a second, square image for WhatsApp.

<meta property="og:image" content="https://emotionathletes.org/images/logo_1200x630_facebook_shared_image_EN.png">
<meta property="og:image:width" content="1200" />
<meta property="og:image:height" content="630" />
<meta property="og:image" content="https://emotionathletes.org/images/logo_400x400_facebook_shared_image_EN.png">
<meta property="og:image:width" content="400" />
<meta property="og:image:height" content="400" />

WhatsApp will use the last image.



来源:https://stackoverflow.com/questions/65329965/open-graph-tag-for-whatsapp-link-sharing

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