I'm trying to exclude the current custom post that is viewed from a list. I've tried with exclude
but it still displays it.
Here is the code I have on single-works.php
:
<?php
$currentID = get_the_ID();
$recent = new WP_Query( 'post_type=works&exclude=' . $currentID . '&showposts=5' );
while ($recent->have_posts()) : $recent->the_post();
?>
<li><?php the_title(); ?>
<?php endwhile; ?>
Any idea what I'm doing wrong and how can I make it work?