Facebook打开图形协议在Tumblr [英] Facebook Open Graph Protocol on Tumblr

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

问题描述

当我的Tumblr博客的链接发布在Facebook上时,Facebook抓住标题标签之间的标题,而不是Open Graph元标记中指定的标题。为什么这样做?有没有办法解决?

When a link from my Tumblr blog is posted on Facebook, Facebook grabs the title between the title tags and not the one specified in the Open Graph meta tags. Why is it doing this? Is there any way to fix it?

推荐答案

没有看到代码,我不知道你的问题是什么,但是对于其他人来说,寻找如何在他们的博客上设置Open Graph,请尝试这样做:

Without seeing the code, I'm not sure what you're problem is exactly, but for anyone else searching for this looking for how to set up Open Graph on their blog, try doing something like this:

<!-- FACEBOOK OPEN GRAPH -->
<!-- >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>-->

<meta property="og:site_name" content="{Title}"/>

{block:PermalinkPage}

    <meta property="og:url" content="{Permalink}"/>
    <meta property="og:type" content="article"/>

        {block:Posts}
            {block:Text}
                {block:Title}<meta property="og:title" content="{PlaintextTitle}"/>{/block:Title}
                <meta property="og:description" content="{PlaintextBody}"/>
            {/block:Text}

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

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

            {block:Quote}
                <meta property="og:title" content="{PlaintextQuote}"/>
                <meta property="og:description" content="{PlaintextSource}"/>
                <meta property="og:image" content="{PortraitURL-64}"/>
            {/block:Quote}

            {block:Link}
                <meta property="og:title" content="{PlaintextName}"/>
                <meta property="og:description" content="{PlaintextDescription}"/>
                <meta property="og:image" content="{PortraitURL-64}"/>
            {/block:Link}

            {block:Chat}
                <meta property="og:title" content="{PlaintextTitle}"/>
                <meta property="og:description" content="{block:Lines}{block:Label}{Label}: {/block:Label}{Line} &bull; {/block:Lines}"/>
                <meta property="og:image" content="{PortraitURL-64}"/>
            {/block:Chat}

            {block:Audio}
                <meta property="og:title" content="{block:Artist}{Artist} - {/block:Artist}{block:TrackName}{TrackName}{/block:TrackName}"/>
                <meta property="og:description" content="{PlaintextCaption}"/>
                {block:AlbumArt}<meta property="og:image" content="{AlbumArtURL}"/>{/block:AlbumArt}
            {/block:Audio}

            {block:Video}
                {block:Caption}<meta property="og:description" content="{PlaintextCaption}"/>{/block:Caption}
            {/block:Video}

            {block:Answer}
                <meta property="og:title" content="{PlaintextQuestion}"/>
                <meta property="og:description" content="{PlaintextAnswer}"/>
                <meta property="og:image" content="{PortraitURL-64}"/>
            {/block:Answer}

        {/block:Posts}

{/block:PermalinkPage}

{block:IndexPage}
        <meta property="og:title" content="{Title}"/>
        <meta property="og:type" content="blog"/>
        <meta property="og:description" content="{MetaDescription}"/>
        <meta property="og:image" content="{PortraitURL-64}"/>
{/block:IndexPage}

应该覆盖任何你可以通过的东西!

Should cover just about anything you can through at it!

请记住,所有代码都属于关闭< / head> 标记之前。

Remember that all of the code belongs before the closing </head> tag.

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

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