问题
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