Google工具在结构化数据部分向我展示了一些错误。
错误说,它找不到作者和更新的信息,在我的网站上的一些网址。
这些URL大多是静态页面,比如推荐信、联系人等等。在这些页面上有一个作者的名字或日期是没有意义的。我们的主题是基于下划线起始主题。
如果您想看到它,请看我们/template-parts/content-page.php文件中的标记是怎样的:
<?php
/**
* Template part for displaying page content in page.php
*
* @link https://developer.wordpress.org/themes/basics/template-hierarchy/
*
* @package design
*/
?>
<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
<header class="entry-header">
<?php the_title( '<h1 class="entry-title">', '</h1>' ); ?>
</header><!-- .entry-header -->
<?php if ( has_post_thumbnail() ) {
the_post_thumbnail();
}
?>
<div class="entry-content">
<?php
the_content();
wp_link_pages( array(
'before' => '<div class="page-links">' . esc_html__( 'Pages:', 'design' ),
'after' => '</div>',
) );
?>
</div><!-- .entry-content -->
<?php if ( get_edit_post_link() ) : ?>
<footer class="entry-footer">
<?php
edit_post_link(
sprintf(
wp_kses(
/* translators: %s: Name of current post. Only visible to screen readers */
__( 'Edit <span class="screen-reader-text">%s</span>', 'design' ),
array(
'span' => array(
'class' => array(),
),
)
),
get_the_title()
),
'<span class="edit-link">',
'</span>'
);
?>
</footer><!-- .entry-footer -->
<?php endif; ?>
</article><!-- #post-<?php the_ID(); ?> -->
任何关于如何修复结构化数据中缺少的作者和更新错误的提示,而不实际将这些错误显示到静态WordPress页面中。
谢谢
https://wordpress.stackexchange.com/questions/289355
复制相似问题