wordpress show post id of custom post types code example
Example: display all custom post type ids
$args = array( 'post_type' => 'case_studies');
$loop = new WP_Query( $args );
while ( $loop->have_posts() ) : $loop->the_post();
the_ID();
endwhile;