Get All IDs Of A Post Type Using WP_Query

You are missing the the_post() function call in the loop. Just add

$the_query->the_post();

in your loop. Apart from that, your loop should work

EDIT

You should also not forget to reset your postdata after the query is done

Leave a Comment

tech