2016-08-29 4 views
0

私は次の機能を使用して、 '特集'カテゴリのmarkerpress製品を取得し、製品イメージをスライドショーに表示します。マーケットプレースのワードプレスwp_queryエラー

$args = array(
    'category_name' => 'featured', 
    'post_type' => 'product' 
); 
$wp_query1 = new WP_Query($args); 
       if (have_posts()) : while ($wp_query1->have_posts()) : $wp_query1->the_post() 

問題は、データをフェッチしないという問題です。私はすべてのデータを表示する以下の関数を使用するだけです。

私は何を間違っているとどのように私は制限を設定しても、データをソートすることができています
$wp_query1 = new WP_Query('post_type=product'); 

。ありがとう。

答えて

0
 <?php $args = array(
     'posts_per_page' => 5, 
     'offset'   => 0, 
     'category_name' => 'featured', 
     'orderby'   => 'date', 
     'order'   => 'DESC', 
     'post_type'  => 'product', 
     'post_status'  => 'publish' 
         ); 
     $posts_array = get_posts($args); ?> 
関連する問題