title: Foreach Loop to Display 2 column with different row
body: <p>I have a query result($wp_query) that getting the latest 5 post, which I want to display in 2 different column (bootstrap grid / column). </p>
  
  <p>The first column will display the first 3 record out of 5, as slider which i used Slippry slider (<a href="http://slippry.com/" rel="nofollow noreferrer">Slippry Slider</a>).</p>
  
  <p>While the second column will display the balance 2 record in individual row, which means 1 record in 1 row. </p>
  
  <p>Im not sure how to do for the second column but I did manage to get the slider, though its showing all 5 record as slider.</p>
  
  <p>Below is my code (its from wordpress functions.php, which i will put in one of my blog page as shortcode)</p>
  
  <p>Any hint will be much appreciated.</p>
  
  <pre><code>function latest_highlights_func($args){
  global $wp_query;
          $args = array(
          'tag__in' =&gt; '24', //must use tag id for this field
          'order' =&gt; 'DESC',
          'posts_per_page' =&gt; '5'
          );
  
  $posts = get_posts($args);
  //echo"fiz==". count($posts);
  //$output = "&lt;div class='vc_col-md-8'&gt;";
  $output = "";
  
  $counter = 1;
  //
      foreach ($posts as $_post) {
          $counter++; 
  
          if ( has_post_thumbnail( $_post-&gt;ID ) ) {
  
              if( $counter == 3 ){
                  $output .= "&lt;div class='vc_col-md-8'&gt;";
                  $output .= "&lt;ul id='slippry-demo'&gt;&lt;li&gt;";
              }
  
              $output .= '&lt;a href="' . get_permalink( $_post-&gt;ID ) . '" title="' . esc_attr( $_post-&gt;post_title ) . '" alt="' . esc_attr( $_post-&gt;post_title ) . '"&gt;'.get_the_post_thumbnail( $_post-&gt;ID, 'full' , array('alt'=&gt; esc_attr( $_post-&gt;post_title )) ).'
                              &lt;/a&gt;';
              if($counter &lt; 4){               
                  $output .= "&lt;/li&gt;&lt;/ul&gt;&lt;/div&gt;&lt;div class='vc_col-md-4'&gt;";
              }
  
              if($counter &lt; 6){
                  $output .= "&lt;/div&gt;";            
              }
          }   
  
      }
  
  echo $output;   
  
      }
      add_shortcode("latest_highlights", "latest_highlights_func"); 
  </code></pre>
  
  <p>Cheers</p>