I am trying to have a section under a single post where it displays completely random posts. I got everything working, but every once in a while one of the random posts that get displayed is the actual post that it is on (the single).
Here is my code:
<?php
$args = array( 'numberposts' => 3, 'orderby' => 'rand' );
$rand_posts = get_posts( $args );
foreach( $rand_posts as $post ) : ?>
<?php endforeach; ?>
Is there anyway to not have it ever display the post it is on?
Thank you.