WordPress divide posts into two divs

I want to divide word press posts into two div but its not working with query posts
how do i achive this?
first ten post in one div and other ten posts in Other div.

<div class="col6">
  <ul class="que_ul clearfix">
    first ten post
  </ul>
</div>
<div class="col6 last">
  <ul class="que_ul clearfix">
    nex ten posts
  </ul>
</div>

Related posts

Leave a Reply

2 comments

  1. You can do something like this

    <?php
    global $wbdb;
     $querystr = "
        SELECT * 
        FROM $wpdb->posts 
        WHERE $wpdb->posts.post_status = 'publish' 
        AND $wpdb->posts.post_type = 'faq'
        LIMIT 0 , 20";
    
     $pageposts = $wpdb->get_results($querystr, OBJECT);?>
         <?php $data_name=array(); ?>
         <?php foreach($pageposts as $posts):?>
         <?php 
          $data_name[]=$posts->post_title;
    
         ?>
         <?php endforeach;?>
    
                       <div class="col6">
                                <ul class="que_ul clearfix">
    
                                <?php for($i=0;$i<10;$i++): ?>
    
                                       <?php if(!empty($data_name[$i])):?>  <li><?php echo $data_name[$i]; ?></li>  <?php endif;?>    
    
                                 <?php endfor;?>   
    
    
                                </ul><!-- end que_ul -->
                            </div><!-- end col-->
                            <div class="col6 last">
                                <ul class="que_ul clearfix">
                                      <?php for($i=10;$i<20;$i++): ?>
    
                                     <?php if(!empty($data_name[$i])):?>  <li><?php echo $data_name[$i]; ?></li>  <?php endif;?> 
    
                                 <?php endfor;?>      
                                </ul><!-- end que_ul -->
                            </div><!-- end col6 last -->