2012年5月16日 星期三

wordpress連續兩個query_post


要先new一個WP_Query出來使用
以下範例
<?php
// 僅顯示標籤帶有cooking的文章
$videoQuery = new WP_Query( 'tag=video' );
 ?>
 <?php

$args = array(
'category_name' => 'frash_news');
query_posts($args);
?>
<?php while ($videoQuery->have_posts()) : $videoQuery->the_post(); ?>
//這裡使用吧!!!!
 <?php endwhile; ?>

沒有留言:

張貼留言