2011-06-18 22 views
0

嗨有沒有辦法通過使用特定模板的wordpress頁面進行循環?使用特定模板循環瀏覽頁面

+0

有任何的源代碼向我們展示你在哪裏卡住了?沒有更具體的細節,很難確定你的問題。 – mrk

回答

4

嘗試以下操作:

$template = 'NAME'; 
$query = new WP_Query(array('meta_key' => '_wp_page_template', 'meta_value' => $template.'.php')); 

while($query->have_posts()) : $query->the_post(); 
    ... 
endwhile;