即使我没有显示当前帖子,如果随机选择,也总是显示5个帖子

With the code below, I show 5 posts ordered randomly at the end of a post. As you can see, if the current post (ID) is one of the random chosen posts then it doesn't show up.

That means instead of the 5 posts I want to show there are 4. In other case, there will be 5 posts.

My question is how to edit the code below to show only 5 posts even if the current post is one of the randomly chosen.

<?php
query_posts( 'posts_per_page=5&orderby=rand' );

while (have_posts()) : the_post();
    if ( $post->ID == $ID  ) continue;
the_title();
endwhile;
    wp_reset_query(); 
?>

Select 1 extra post anticipated and only show it if you had to skip one.

-edit- This is very ugly but it should work:

<?php
    query_posts( 'posts_per_page=6&orderby=rand' );
    $counter = 0;
    while (have_posts()) : the_post();
        if ( $post->ID == $ID  || $counter == 5 ) continue;
        $counter++;
        the_title();
    endwhile;
    wp_reset_query(); 
?>