We’re rewarding the question askers & reputations are being recalculated! Read more.
3 If we want to echo the id, we just use the_ID().
source | link

Found the basis of the answer buried in the codex

$args = array( 'post_type' => 'case_studies');

$loop = new WP_Query( $args );
while ( $loop->have_posts() ) : $loop->the_post();
    echo the_idthe_ID();
endwhile;

Found the basis of the answer buried in the codex

$args = array( 'post_type' => 'case_studies');

$loop = new WP_Query( $args );
while ( $loop->have_posts() ) : $loop->the_post();
    echo the_id();
endwhile;

Found the basis of the answer buried in the codex

$args = array( 'post_type' => 'case_studies');

$loop = new WP_Query( $args );
while ( $loop->have_posts() ) : $loop->the_post();
    the_ID();
endwhile;
2 deleted 25 characters in body
source | link

Found the basis of the answer buried in the codex

$args = array( 'post_type' => 'case_studies');

$loop = new WP_Query( $args );
while ( $loop->have_posts() ) : $loop->the_post();
    echo the_title();
    echo get_the_idthe_id();
endwhile;

Found the basis of the answer buried in the codex

$args = array( 'post_type' => 'case_studies');

$loop = new WP_Query( $args );
while ( $loop->have_posts() ) : $loop->the_post();
    echo the_title();
    echo get_the_id();
endwhile;

Found the basis of the answer buried in the codex

$args = array( 'post_type' => 'case_studies');

$loop = new WP_Query( $args );
while ( $loop->have_posts() ) : $loop->the_post();
    echo the_id();
endwhile;
1
source | link

Found the basis of the answer buried in the codex

$args = array( 'post_type' => 'case_studies');

$loop = new WP_Query( $args );
while ( $loop->have_posts() ) : $loop->the_post();
    echo the_title();
    echo get_the_id();
endwhile;