Tumblr会忽略打开的图形标签 [英] Tumblr ignores open graph tags

查看:63
本文介绍了Tumblr会忽略打开的图形标签的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在网站上有一些社交分享按钮.我已经能够使用开放图标记来确切指定我想要共享的内容.他们与除Tumblr之外的所有主要社交网络合作.有谁知道为什么或者我应该做什么?谢谢!

I have some social sharing buttons on a site. I've been able to use the open graph tags to specify exactly what I want shared. They work with every major social network except Tumblr. Does anyone know why or what I should be doing instead? Thanks!

推荐答案

尽管这是一个较旧的帖子,但我还是碰到了它,并认为我会为将来的人们发布一个回复.我希望OP能够找到更及时的答案.

Even though this is an older post, I came across it and figured I'd post a reply for future folks. I hope the OP found a more timely answer.

这取决于您的打开图形标记的设置方式-在您的索引页面上?还是在您的永久链接页面上? Facebook不允许您传递参数,它只能获取页面上的内容.因此,在索引页面上它只能获取一般的博客信息,因为在有很多帖子的页面上根本无法写出唯一的OG元标记.而在各个固定链接页面上,您可以创建打开的图形标签以特定于帖子.这是来自addthis.com支持页面的链接,该链接说明了Facebook如何获取其打开的图形信息以及为什么从主索引页面共享时为什么它不是特定于发布的:

It depends how your open graph tags set up - on your index page? Or on your permalink pages? Facebook does not allow you to pass it parameters, it can only grab what is on the page. So on the index page it can only grab the general blog info since there's no way on a page with many posts write out unique OG meta tags. Whereas on the individual permalink pages you can create the open graph tags to be specific about the post. Here is a link from the addthis.com support page that explains how facebook grabs its open graph info and why it's not post specific when shared from the main index page: http://support.addthis.com/customer/portal/questions/245592-share-buttons-on-tumblr-posts

这里是喜欢"按钮页面的链接,该链接总体上解释了打开的图形标记的工作方式: http://developers.facebook.com/docs/reference/plugins/like/

Here is a link to the Like button page that explains overall how the open graph tags work: http://developers.facebook.com/docs/reference/plugins/like/

这里是设置tumblr模板的示例,以便它可以在永久链接页面上获取更详细的信息:

Here is an example of setting up your tumblr template so that it can grab more detailed information on the permalink pages:

<!-- OPEN GRAPH INFO-->
<meta property="og:type" content="blog" />
<meta property="og:site_name" content="{Title}" />
{block:PermalinkPage}
   <meta property="og:title" content="{block:PostSummary}{PostSummary}{/block:PostSummary}" />
{block:Posts}

{block:Photo}
  <meta property="og:image" content="{PhotoURL-500}" />
{/block:Photo}

{block:Answer}
   <meta property="og:image" content="{AskerPortraitURL-128}"/>
{/block:Answer}

{block:Text}
  <meta property="og:image" content="{PortraitURL-128}" />
{/block:Text}

{block:Photoset}
 {block:Photos}
   <meta property="og:image" content="{PhotoURL-500}" />
 {/block:Photos}
{/block:Photoset}

{block:Quote}
   <meta property="og:image" content="{PortraitURL-128}" />
{/block:Quote}

{block:Link}
   <meta property="og:image" content="{PortraitURL-128}" />
{/block:Link}

 {block:Chat}
   <meta property="og:image" content="{PortraitURL-128}" />
 {/block:Chat}

{block:Video}
  <meta property="og:image" content="{PortraitURL-128}" />
{/block:Video}

{/block:Posts}

{/block:PermalinkPage}

{block:IndexPage}
   <meta property="og:title" content="{block:Description}{MetaDescription}{/block:Description}" />
   <meta property="og:image" content="{PortraitURL-128}" />
{/block:IndexPage}

<meta property="fb:app_id" content="YOUR_FB_APP_ID" /> <!-- YOU CAN ALSO USE A DIFFERENT TAG FOR YOUR PROFILE ID INSTEAD NOTE - use one of the other, not both -->
<meta property="fb:admins" content="YOUR_FB_ADMIN_ID" />
<!-- END OPEN GRAPH -->

这篇关于Tumblr会忽略打开的图形标签的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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