I want to get all Orders from WooCommerce over WP_Query()
but the while is not ending and i got a blank page
ourrent query:
$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();
The var_dump($the_query) is here http://laravel.io/bin/KmwlK
In
while ( $the_query->have_posts() )
, you didn’t put the functionthe_post()
. Maybe use it will solve your problem.