缺少作者 ;缺少谷歌网站管理员工具中的更新



我在我的网站上得到了缺少作者和更新错误。所以我在我的函数中添加了以下功能.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');`

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

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

最新更新