// Show posts in order of post__in array
$id_array = array(589,39,981,531);
$args = array(
'post__in' => $id_array,
'ignore_sticky_posts' => 1, // Stickies will mess this up
);
query_posts($args);
if (have_posts()) :
usort($wp_query->posts, function($a, $b) use ($id_array) {
return array_search($a->ID, $id_array) - array_search($b->ID, $id_array);
});
while (have_posts()) :
// Put your own loop code here
the_post();
echo "<p>ID: $post->ID</p>";
endwhile;
endif;