nvm i got it working with this code:
<?php
$categories = get_categories('child_of=2');
foreach ($categories as $cat) {
echo "<h3>" . $cat->name . "</h3>";
query_posts('cat=' . $cat->term_id);
while (have_posts()) : the_post();
?>
<a href="<? the_permalink(); ?>" title="<? the_title(); ?>"><? the_title(); ?></a><br />
<?php
endwhile;
};
?>
but when i change the while loop to only show 5 posts it shows the parent category’s name instead :S
is there a better way of doing this??