$args = array( 'numberposts' => 5, 'offset' => 0, 'category' => 7, 'post__not_in' => array( $post->ID ) ); $myposts2 = get_posts($args);

wordpress loop over posts but exclude current post

Similar Code Examples