You can get the list of other posts with same post parent by running a custom query. You should supply parent post id in post_parent
parameter to WP_Query
and exclude current post from custom query.
So this will be the custom query.
$parentpost = wp_get_post_parent_id( $post->ID );
if ( $parentpost && $parentpost != '0' ) {
$currentpost = array( $post->ID );
$args = array(
'post_type' => 'cpt-name',
'post_parent' => $parentpost,
'post__not_in' => $currentpost,
'ignore_sticky_posts' => 1,
'paged' => $paged,
);
$my_query = new WP_Query( $args );
if ( $my_query->have_posts() ) :
while ( $my_query->have_posts() ) : $my_query->the_post();
the_title();
endwhile;
endif;
wp_reset_postdata();
} else {
echo "Do something else.";
}
Oh and also, you will have to add your custom post type name in above code to work. I added cpt-name
right now as an example. I hope this helps.