我有一个显示帖子的代码,如果has\\u post\\u thumpinal,问题是它会显示所有帖子,无论有没有thumpinal
<?php
global $post;
$args = array( \'numberposts\' => 5 );
$postQuery = get_posts($args);
$num = 0;
foreach( $postQuery as $post ) : setup_postdata($post);
if ( has_post_thumbnail() ) { ?>
<div style="display: inline-block;; ">
<a href="<?php echo get_permalink(); ?>" title="Go to <?php echo the_title(); ?>" rel="bookmark">
<?php the_post_thumbnail(\'medium\'); ?>
</a>
</div>
<div style="display: inline-block; width:50%; vertical-align: top;">
<span style="vertical-align: top;" class="flex-caption"><?php the_title(\'<h1>\',\'</h1>\'); ?>
<?php the_content(); ?>
</span>
</div>
<?php
}
endforeach; ?>