首页 > CMS建站 > Wordpress > 正文

wordpress提示Missing required field entry-title updated hCard author错误

2020-06-10 12:56:50
字体:
来源:转载
供稿:网友

wordpress提示Missing required field entry-title updated hCard author错误是什么原因呢?下面小编就为各位来介绍关于此问题的解决办法吧.

google管理员工具报提取的结构化数据错误,以前都没有的,最近在做blog的手机站,我在想是不是这个引起的,错误如下.

错误:Missing required field "entry-title".

错误:Missing required field "updated".

错误:Missing required hCard "author".

1,解决 Missing required field "entry-title"

在标题<?php the_title(); ?>外层加上class entry-title

<h1 class="title"><?php the_title(); ?></h1>

改为:

<h1 class="title entry-title"><?php the_title(); ?></h1>

2,解决Missing required field "updated".

在文章发表时间<?php the_time('Y-m-d'); ?>或者<?php the_date();?>外面加上class updated.//开源软件:Cuoxin.com

<span class="date"><?php the_time('Y-m-d'); ?></span>

改为:

<span class="date updated"><?php the_time('Y-m-d'); ?></span>

3,解决 Missing required hCard "author"

<?php the_author(); ?>

改为:

<span class="vcard author"><span class="fn"><?php the_author(); ?></span></span>

文章发表出来,说明我的问题解决了,只不过网上有人说,只需要改single.php就行了,到底是不是自己测试一下.

发表评论 共有条评论
用户名: 密码:
验证码: 匿名发表

图片精选