With the code below how is it possible to show the posts under each of the categories? Right now the code shows the name and a thumbnail for the category, but I'm trying to figure out how to list the posts for those categories under the category names too.
<?php $term = get_term_by( 'slug', get_query_var($wp_query->query_vars['taxonomy']), $wp_query->query_vars['taxonomy']); ?>
<?php $categories = get_term_children( $term->term_id, 'product_cat' ); ?>
<?php if ( sizeof( $categories ) ) : ?>
<ul class="product_list">
<?php
foreach ( $categories as $category ) {
$term = get_term_by( 'id', $category, 'product_cat' );
$title = $term->name;
$thumb = jigoshop_product_cat_image( $term->term_id );
if ( $thumb['thumb_id'] )
$thumb_image = wp_get_attachment_image( $thumb['thumb_id'], 'shop_small' );
else
$thumb_image = jigoshop_get_image_placeholder();
?>
<li class="category">
<a href="<?php echo get_term_link( $term->slug, 'product_cat' ); ?>" title="<?php echo $title; ?>">
<div class="thumb"><?php echo $thumb_image; ?></div>
<div class="title"><strong><?php echo ( strlen( $title ) > 70 ) ? substr( $title , 0, 70) . '...' : $title; ?></strong></div>
</a>
<a href="<?php echo get_term_link( $term->slug, 'product_cat' ); ?>" class="button" title="<?php echo __('View', 'jigoshop') . ' ' . $title; ?>"><?php echo __('View', 'jigoshop'); ?></a>
</li>
<?php
}
?>
</ul>
<div class="clear"></div>
<?php else: ?>
<?php jigoshop_get_template_part( 'loop', 'shop' ); ?>
<?php do_action('jigoshop_pagination'); ?>
<?php endif; ?>