Recent post in different layout from same category

<div class="container">
  <div class="row">
    <?php
    $args = array(
      'post_type' => 'post',
      'posts_per_Page' => 3,
    );

    $query = new WP_Query($args);

    while ($query->have_posts()) {
      $query->the_post();
    ?>
      <?php
      if (1 > $query->current_post) {
      ?>
        <div class="col-md-8 col-sm-12 col-xs-12 first-column">
          <div class="single-item"></div>
        </div>
      <?php

      } else if (3 > $query->current_post) {
      ?>
        <div class="col-md-4 col-sm-12 col-xs-12 column">
          <div class="single-item"></div>
        </div>
      <?php
      }
      ?>
    <?php
    }
    wp_reset_postdata();
    ?>
  </div>
</div>

Leave a Comment

Your email address will not be published.

AllEscortAllEscort