我已经找到了解决方案。我使用WP\\u Query作为解决方案。代码如下:
<?php
// The Query
$query = new WP_Query( array(
\'posts_per_page\' => 4,
\'tax_query\' => array(
array(
\'taxonomy\' => \'post_format\',
\'field\' => \'slug\',
\'terms\' => array(\'post-format-video\'),
\'operator\' => \'IN\')
)
) );
if ( $query->have_posts() ) : while ( $query->have_posts() ) : $query->the_post();
get_template_part( \'template/loop\', \'video\' );
endwhile; wp_reset_postdata(); else : ?>
<p><?php _e( \'Sorry, no posts matched your criteria.\' ); ?></p>
<?php endif; ?>
因此,它将只显示video post格式。:)