the only thing that code says is... "this is the parent" it says that no matter the post, no matter the category.
i use this code below for the current category on a sing post page:
<?php
if (is_single( )) {
$post_ID = $wp_query->posts[0]->ID;
$all_cats_of_post = get_the_category($post_ID);
$first_cat_ID = $all_cats_of_post[0]->cat_ID;
$first_cat_name = $all_cats_of_post[0]->cat_name;
?>
<div id="category-posts-<?php echo $first_cat_ID; ?>" class="widget widget_recent_entries">
<div class="widget-title"><b>Last 5 posts in <?php echo $first_cat_name; ?>:</b></div>
<div class="widget-content">
<table width=450><tr><td width=5%></td><td>
<?php global $post; $cat_posts = get_posts('numberposts=5&category='.$first_cat_ID);
foreach($cat_posts as $post) : ?>
<li><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></li><br />
<?php endforeach; ?>
</div>
</div>
<?php } ?>
</td></tr></table>
it displays the category name and links automatically, and i was looking for something similar for the parent category. for example if it is a post in my 'wrestling news' category, i want to show the last 5 post in that category (like i already do) and the last 5 post overall in the parent 'wrestling' category.
is there a query or other way of doing that?