你可以做這樣的事情
<?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 -->
偉大的,對我的作品.. – Vishal