我使用了以下代码来显示每篇文章的特色图像,但没有显示任何内容:
<div class="thumbnail-img">
<?php
$lastBlog = new WP_Query(\'type=post&posts_per_page=2&offset=1\');
if ($lastBlog->has_post_thumbnail()) {
while($lastBlog->has_post_thumbnail()) {
$lastBlog->the_post_thumbnail();
} ?>
<?php get_template_part(\'content-image\', get_the_post_thumbnail());
}
?>
</div>
<br>
<?php
if( $lastBlog->have_posts()):
while($lastBlog->have_posts()): $lastBlog->the_post(); ?>
<?php get_template_part(\'content-title\', get_post_format()); ?>
<?php endwhile;
endif;
wp_reset_postdata();
?>
</div>
如何解决此问题?