最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

How can I add a second Open Graph image to a site using Yoast?

programmeradmin1浏览0评论
Closed. This question is off-topic. It is not currently accepting answers.

Your question should be specific to WordPress. Generic PHP/JS/SQL/HTML/CSS questions might be better asked at Stack Overflow or another appropriate Stack Exchange network site. Third-party plugins and themes are off-topic for this site; they are better asked about at their developers' support routes.

Closed 5 years ago.

Improve this question

Through the Yoast SEO plugin, I've added a 1200 by 630 image for use by sites like Facebook and LinkedIn (and the image shows up with a complete set of og meta tags).

I want to add a second open graph image (a square one) for use by WhatsApp (WhatsApp selects the last image and crops it to a 1 by 1.3 portrait aspect ratio and then displays it at 80 by 104 pixels, which doesn't work well with the image layout that works well with Facebook (and LinkedIn).

I don't think Yoast directly supports a second image, but is there a way using functions.php to add a second image (with the op:image, og:image:secure_url, og:image:height, og:image:width, and og:image:alt meta fields)? I wouldn't need the image data to be done programmatically, as I would use the same image for every page, so the information could be hard coded into functions.php.

Thanks for the help.

I've reposted the question at Stackoverflow for help with the PHP code.

发布评论

评论列表(0)

  1. 暂无评论