Answers for "wordpress exclude current post from loop"

PHP
0

wordpress exclude current post from loop

$args = array(
    'numberposts' => 5,
    'offset' => 0,
    'category' => 7,
    'post__not_in' => array( $post->ID )
);
$myposts2 = get_posts($args);
Posted by: Guest on April-23-2020

Code answers related to "wordpress exclude current post from loop"

Browse Popular Code Answers by Language