Blogger的Facebook Open Graph标签 [英] Facebook Open Graph tags for Blogger

查看:61
本文介绍了Blogger的Facebook Open Graph标签的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

几个月来我一直在努力挣扎.

I've been struggling with these for months now.

我刚刚更改了它们,Facebook Debugger认为一切正常,除了管理员和应用程序ID,我希望我不必介入.

I just changed them and the Facebook Debugger thinks everything's fine except for admins and app ID whih I hope I don't have to get into.

但是,当单击喜欢"按钮时,有些帖子显示我的通用图标,有些则显示旧帖子的图像,有些则完全不显示图像,极少数显示该帖子的图像.

But, when the like button is clicked, some posts show my generic favicon, some show an image for an old post, some show no image at all, and a rare few show an image from the post.

其中有些显示博客文章的正确标题,有些显示链接,有些则什么也不显示.

Some of them show the correct title of the blog post, some show a link instead, some show nothing.

我希望帖子中的一小段文字能显示出来,但那永远不会发生.

I was hoping that a brief snippet of text from the post would show but that never happens.

这一切似乎完全是随机的.这是我网站的代码:

This all seems to be totally random. Here's my code for my site:

<!-- BEGIN Open Graph tags -->
<meta expr:content='data:blog.metaDescription' name='description' property='og:description'/>
<meta expr:content='data:blog.pageTitle' name='keywords'/>
<b:if cond='data:blog.pageType == &quot;item&quot;'>
<meta content=blog' property='og:type'/>
<meta content='http://speechnotrecognised.blogspot.com.au/2012/08/our-second-first-post_28.html' property='article:author'/>
<meta expr:content='data:blog.url' property='og:url'/>
<meta expr:content='data:blog.pageName' property='og:title'/>
<b:if cond='data:blog.postImageThumbnailUrl'>
<meta expr:content='data:blog.postImageThumbnailUrl' property='og:image'/>
<b:else/>
<meta content='http://i1252.photobucket.com/albums/hh569/speechnotrecognised/snricon4_zpsde4bdf38.jpg' property='og:image'/>
</b:if>
<b:else/>
<meta expr:content='data:blog.title' property='og:title'/>
<meta expr:content='data:blog.homepageUrl' property='og:url'/>
<meta content='blog' property='og:type'/>
<meta content='http://i1252.photobucket.com/albums/hh569/speechnotrecognised/snricon4_zpsde4bdf38.jpg' property='og:image'/>
</b:if>
<meta expr:content='&quot;en_US&quot;' property='og:locale'/>
<!-- END Open Graph tags -->

推荐答案

我发现您的代码有几个问题: -您正在使用博客标题生成关键字吗?! -对于单个博客帖子,og:type应该是文章"而不是博客"; -我认为您不能为article:author使用URL; -您未指定Facebook管理员ID或应用ID; -您应该使用规范的URL而不是data:blog.homepageUrl来解决博客作者的国家/地区重定向.

I see several problems with your code: - you are using the blog title to generate keywords?! - for individual blog posts og:type should be 'article' not 'blog'; - I don't think you can use an URL for article:author; - you don't specify either your Facebook admin ID or the app ID; - you should use the canonical URL instead of data:blog.homepageUrl to work around blogger's country redirection.

这是我的解决方案:打开Blogger [版本3]的图形标记

这篇关于Blogger的Facebook Open Graph标签的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆