In an attempt to speed up my query, I'm using the following arguments:
$args = array( 'post_type' => 'product', 'fields' => 'ids', ); $query = new WP_Query($args);
While this does return an array of IDs as expected, I keep getting multiple
Trying to get property of non-object in /wp-includes/query.php notices. This happens even when I have nothing inside my
while other than
if ($query->have_posts()) : while ($query->have_posts()) : $query->the_post(); endwhile; endif;
the_post() causing this? Any idea why I'm getting these notices?