缺少作者;缺少谷歌网站主工具更新

时间:2018-06-07 07:03:39

标签: php wordpress

我找到了遗失的作者,并在我的网站中遗漏了更新的错误。所以我在funtion.php中添加了以下功能。它解决了所有帖子中缺少的作者和缺少更新的错误,但错误仍然存​​在于主页中。如何解决它。请帮帮我。

function add_suf_hatom_data($content) { 
    $t = get_the_modified_time('F jS, Y');
    $author = get_the_author();
    $title = get_the_title();

    if (is_home() || is_singular() || is_archive() ) {
        $content .= '<div class="hatom-extra" style="display:none;visibility:hidden;"><span class="entry-title">'.$title.'</span> was last modified: <span class="updated"> '.$t.'</span> by <span class="author vcard"><span class="fn">'.$author.'</span></span></div>';
    }

    return $content;
}

add_filter('the_content', 'add_suf_hatom_data');`

1 个答案:

答案 0 :(得分:0)

Google指的是作者和上次修改的元标记。您应该将它们添加到每个页面的<head>。例如:

<meta http-equiv="last-modified" content="YYYY-MM-DD" />
<meta name="author" content"Someone" />