WP 投稿ページの関連記事から表示中の記事を除外

<?php
$args = array(
    'posts_per_page' => 3,
    'category' => $cats[0]->term_id,
    'post__not_in' => array($post->ID)
);
$posts = get_posts($args);
foreach ($posts as $post) :
    setup_postdata($post); // 記事データの取得
?>
    <?php get_template_part('template-parts/loop', 'article'); ?>
<?php
endforeach;
wp_reset_postdata();
?>

参考にした記事は下記です!感謝です!

theorthodoxworks.com