An example:
$posts_ids = array(2,56,87,23,5); // this is an array of posts IDs $posts_ids)); ?> have_posts()) : $my_query-> the_post(); ?>
Read Article https://develop.horje.com/learn/1434/reference