wp_query exclude current 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);