I have a custom post type for accessories. When you view the post it also shows related posts. It looks great, but it also shows the current post within related posts.
Is there a way to exclude the current post from the loop?
<div>
<?php
$category = get_the_category();
$model = $category[1]->cat_name;
$accessory = array('numberposts' => 8, 'offset'=> 1, 'post_type' => 'accessory', 'category_name' => $model, 'order' => 'DESC');
query_posts( $accessory );
?>
<?php if (have_posts()) : ?>
<?php while (have_posts()) : the_post(); ?>
<div>
<?php wp_link_pages( array( 'before' => '<div class="page-link">' . __( 'Pages:', 'openeye' ), 'after' => '</div>' ) ); ?>
<h4><?php the_title(); ?></h4>
Part Number: <?php echo get_post_meta($post->ID, "accessory-part-number", true); ?>
<?php $desc = get_post_meta($post->ID, "accessory-description", true); ?>
<p><?php echo utf8_truncate( $desc ); ?></p>
<a href="<?php echo get_permalink(); ?>">Learn more about the <?php the_title(); ?></a>
</div>
<?php endwhile; ?>
<?php endif; ?>
</div>
</div>