2014-06-11 4 views
0

표시하지만 동안은 종료되지 않고, 난 빈 페이지 ourrent 쿼리 가지고 :WP_Query있는 동안 나는 WP_Query()</p> <p>이상 WooCommerce에서 모든 주문을 얻으려면 빈 페이지

 $type = 'shop_order'; 
     $args = array(
      'post_type'  => $type, 
      'post_status' => 'any', 
      'posts_per_page' => -1, 
     ); 


     $the_query = new WP_Query($args); 

     var_dump($the_query); //This Showes something 


     if ($the_query->have_posts()) { 

      //here comes the blank page 
      while ($the_query->have_posts()) { 

      } 

     } 
     wp_reset_postdata(); 

위해서 var_dump를 ($ the_query)는 여기에 http://laravel.io/bin/KmwlK

+0

실제로 뭔가를 출력하고 있습니까? (나는 분명하지만 더 잘 알아) – FLX

답변

0

while ($the_query->have_posts())에는 the_post()을 입력하지 않았습니다. 어쩌면 그것을 사용하여 문제를 해결할 수 있습니다.

//here comes the blank page 
while ($the_query->have_posts()) { 
    the_post(); // add it 
} 
+0

안녕하세요,하지만 다른 해결책을 찾았습니다.이 complty가 잘못되었음을 알았습니다. http://laravel.io/bin/nYD49 – cannap

+0

대신 the_post();가 있어야합니다. '$ the_query-> the_post();'. – Raptor