更改 CPT 存档模板中最近 post 的布局和样式

Change layout and styling for most recent post in CPT archive template

我有一个名为 'Blog' 的自定义 post 类型,其存档模板为 archive-su_blog.php。在模板中,我只是调用标准循环来拉入所有 post,然后使用一些 html 来构建页面。

我想知道是否可以更改最近 post 的 html 和样式?而不是所有人都使用相同的 html。我知道如何使用自定义查询来执行此操作,但我很好奇是否有办法使用标准循环来执行此操作?

我想用标准 if ( have_posts() ) : while ( have_posts() ) : the_post(); 循环做什么的例子。

<div class="featured-post">
<div class="col-sm-6 featured-img"><img src=""></div>
<div class="col-sm-6 featured-info"> </div>
</div>

<div class="default-post">
<div class="post-info"></div>
</div>

谢谢

// Query Arguments
$args = array(
    'post_type' => array('blog'),
    'order' => 'DESC',
    'orderby' => 'date',
);

// The Query
$query = new WP_Query( $args );

// The Loop
if ( $query->have_posts() ) {
    $i = 0;
    while ( $query->have_posts() ) {
        if($i ==0){
            // My Custom style
            $query->the_post();
            ?>
            <div class="featured-post">
            <div class="col-sm-6 featured-img"><img src=""></div>
            <div class="col-sm-6 featured-info"> </div>
            </div>
            <?php
            // End of my Custom style
            $i++;
        }else{
            $query->the_post();
            ?>
            <div class="default-post">
            <div class="post-info"></div>
            </div>
            <?php
        }           
    }
} else {
    // no posts found
}
/* Restore original Post Data */
wp_reset_postdata();