i have 4 posts belonging to "news" category. I've added a this code in single.php to show the title of other posts in the same category in the sidebar.
<?php
$query = "showposts=10&orderby=rand&cat=";
foreach((get_the_category()) as $category) {
$query .= $category->cat_ID .",";
}
query_posts($query);
?>
<ul class="related grid_5">
<?php while (have_posts()) : the_post(); ?>
<li><?php the_title() ?></li>
<?php endwhile; ?>
</ul>
using this i can retrieve all posts in the same category and display them and all 4 titles belonging to "news" are displayed in the widget. but I'm on post#3 how can show only #1, #2, and #4 titles in the widget?