我正在运行一个Wordpress网站并创建了一个自定义主题.现在我一直坚持优化它Google PageSpeed
.它显示了Mobile页面的以下内容:
考虑修复:只有大约63%的最终首屏内容可以使用完整的HTML响应进行呈现
这是因为我Featured Image
在index.php中包含了上面的帖子,代码如下:
<p>
<?php if ( has_post_thumbnail() ) : ?>
<a href="<?php the_permalink(); ?>" title="<?php the_title_attribute(); ?>">
<?php the_post_thumbnail(); ?>
</a>
<?php endif; ?>
</p>
Run Code Online (Sandbox Code Playgroud)
我该如何解决这个问题?在我看来,除了网站的标志之外,我在特色图片之前加载的是侧边栏.为了更深入的理解,这里是我的index.php的完整代码
<?php get_header(); ?>
<div id="main">
<div id="content">
<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
<p>
<?php if ( has_post_thumbnail() ) : ?>
<a href="<?php the_permalink(); ?>" title="<?php the_title_attribute(); ?>">
<?php the_post_thumbnail(); ?>
</a>
<?php endif; ?>
</p>
<h1>
<a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link …
Run Code Online (Sandbox Code Playgroud)