As already mentioned <a href="https://wordpress.org/support/topic/current-post-is-not-excluded/" target="_blank" rel="noopener">here</a> I\'m having issues with the related posts plugin. I\'m using Content Views Pro to display posts and the related posts plugin in the sidebar via shortcode. I would expect the current post not to show in that list, but it\'s there. I also tried adding this to my functions.php:
<pre>add_action(\'related_post_main\', \'remove_related_posts\', 2);
<strong>$excluded_posts = get_the_ID();</strong>
$post_id = get_the_ID();
which should remove the current post, right? Am I missing something else?
Welcome to our forum.
have you checked my reply on wp.org?