wp query posts that not thecurrent post code example
Example: wordpress loop over posts but exclude current post
$args = array(
'numberposts' => 5,
'offset' => 0,
'category' => 7,
'post__not_in' => array( $post->ID )
);
$myposts2 = get_posts($args);