Get posts in between specific ID’s

You can simply just use the post__in parameter inside your query arguments or inside your pre_get_posts action

EXAMPLE

(Adjust as necessary. Code requires at least PHP 5.4+ due to short array syntax ([]))

$args = [
    'post__in' => range( 10, 15 ),
];
$q = get_posts( $args );
var_dump( $q );