我试图显示公文包页面上最近的项目。我已经在我的项目中添加了此代码。php文件。它显示一个上载的图像,但不显示上载到post portfolio的其他图像和文本。
<?php
$args = array(
\'numberposts\' => 6,
\'post_type\' => \'portfolio\',
\'orderby\' => \'post_date\',
\'order\' => \'ASC\',
\'post_status\' => \'publish\',
);
$recent_posts = wp_get_recent_posts( $args, ARRAY_A );
?>
<section id="project" class="recent-clients">
<h4>Recent Projects</h4>
<div class="container cf" style="margin-bottom: 11em;">
<?php if($query-> have_posts() ) : while( $query->have_posts() ) : $query->the_post(); ?>
<div class="col-sm-4 hover hover-first">
<img src="<?php the_post_thumbnail( array(320, 320) );?>
<a href="<?php the_permalink();?>"><div class="mask">
<h2>Battalion1944 Website</h2>
<p>Web Design & Web Development</p>
</div></a>
</div>
<?php endwhile; endif; wp_reset_postdata(); ?>
</div>
</section>