I am trying to get a list of a custom post type's IDs using WP_Query, but it is returning undesired result, which is a memory leak and stuck browser.
Here is the code I use:
$the_query = new WP_Query("post_type=post&posts_per_page=-1&field=ids");
if ($the_query->have_posts()) {
while ($the_query->have_posts()){
echo get_the_ID();
}
}
It makes my browser infinitely trying to load the page. May be somebody know what's wrong with the code above..