【问题标题】:Facebook Open-graph Tag for multiple authors in Wordpress在 Wordpress 中为多个作者提供 Facebook 开放图标签
【发布时间】:2014-08-14 10:27:42
【问题描述】:

我一直在尝试将 facebook article:author 元标记添加到 wordpress,不幸的是我不知道如何为多个作者添加它。这是我到目前为止所做的,但作者的名字仍然没有出现在 Facebook 分享中。

<meta property="article:author" content= "<?php $author = get_the_author(); ?>" />

【问题讨论】:

    标签: php facebook wordpress facebook-graph-api facebook-opengraph


    【解决方案1】:

    根据https://developers.facebook.com/docs/reference/opengraph/object-type/article#properties article:author 包含

    本文作者的 Facebook 个人资料 URL 或 ID 数组。

    截至https://developers.facebook.com/docs/opengraph/creating-custom-stories/#propertytypes-simple

    您可以通过为数组的每个元素重复相同的元标记名称来定义数组值。

    示例

    <meta property="cookbook:ingredients" content="Chocolate"> 
    <meta property="cookbook:ingredients" content="Sugar"> 
    <meta property="cookbook:ingredients" content="Butter"> 
    

    确保你定义

    <meta property="og:type" content="article" /> 
    

    也是。

    【讨论】:

    • 那么该标签应该怎么走呢?只是一个数组? &lt;meta property="article:author" content="author1, author2, author3" /&gt; ?
    • 我按照你说的添加了...但是调试工具根本不会显示article:author标签!
    • 您可以粘贴链接吗?您是否添加了 og:type 属性?
    • 是的,我添加了og:type 属性并将内容设置为文章!还是一样!我正在为客户工作,我无法在此处粘贴任何链接!
    • 根据plugins.svn.wordpress.org/wordpress-seo/trunk/frontend/…的代码,如果页面显示的是单篇文章,则只会显示作者,而不是多篇:codex.wordpress.org/Function_Reference/is_singular是这样吗?
    猜你喜欢
    • 2013-11-28
    • 2012-01-18
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-04-26
    相关资源
    最近更新 更多