display custom post type post by id code example
Example 1: display custom post type
$args = array(
'post_status' => 'publish',
'posts_per_page' => 5,
);
$loop = new WP_Query( $args );
while ( $loop->have_posts() ) : $loop->the_post();
the_title();
the_excerpt();
endwhile;
Example 2: 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;