Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

wordpress exclude current post from loop

$args = array(
    'numberposts' => 5,
    'offset' => 0,
    'category' => 7,
    'post__not_in' => array( $post->ID )
);
$myposts2 = get_posts($args);
Source by wordpress.stackexchange.com #
 
PREVIOUS NEXT
Tagged: #wordpress #exclude #current #post #loop
ADD COMMENT
Topic
Name
8+9 =