如何在不访问的情况下设置打开图默认图像
我有一个网站,我可以在页面上修改/添加 html、PHP 和 JS 代码,但我无权访问 部分。
如何为打开的图表设置默认图像,以便在 Facebook 上共享页面时正确显示?
I have a website on which I can modify/add html, PHP, and JS code on the page but I do not have access to the <head></head>
section.
How can I set a default image for open graph so that it shows correctly when the page is being shared on Facebook?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
linter (https://developers.facebook.com/tools/debug) 只喜欢在 HTML 部分中看到 og: 标签。
我什至尝试使用 javascript 以编程方式将它们放入 HEAD 的 DOM 中,但 linter 似乎没有运行脚本。它似乎正在查找所以我的建议是寻找更好的托管解决方案,尝试一下 GoDaddy.com 的托管包价格。更好:)
The linter (https://developers.facebook.com/tools/debug) only likes to see the og: tags in the section of the HTML.
I've even tried to put them into the DOM of the HEAD programmatically using javascript, but the linter doesn't appear to run the script. It appears to be looking in the originally downloaded HTML. So my advice is to look around for a better hosting solution. Try GoDaddy.com for some awesome pricing on hosting packages. You will need to gain access to the HEAD section and if you control the files, you'll be better off :)