I have this piece of ode in a buy template. I like to know what to add to get the child name of the category
the mais display category is sponsor. but in the sponsor category, there is : gold, silver, platium... i want to get that "color" category an output it as <div class="cat-name">platium</div>
here is the code :
<div id="carouselContainer">
<h2 id="sponsorsTitle"><?php echo get_cat_name( $carouselCategory ) ?></h2>
<ul id="carousel">
<?php $showPostsInCategory = new WP_Query(); $showPostsInCategory->query('cat='. $carouselCategory .'&showposts='. $carouselNumber .'');
if ($showPostsInCategory->have_posts()) : while ($showPostsInCategory->have_posts()) : $showPostsInCategory->the_post();?>
<li>
<?php $data = get_post_meta( $post->ID, 'key', true ); ?>
<?php echo get_cat_name( $carouselCategory ) ?>
<a href="<?php if ($data[ 'custom_link' ]) { echo $data[ 'custom_link' ];} else { the_permalink(); } ?>">
<?php the_post_thumbnail('sponsor', array('title' => "")); ?>
</a>
</li>
<?php endwhile; endif; ?>
</ul><!--end carousel-->
</div><!--end carouselContainer-->
<?php } ?>
<div id="footerContainer">
<div id="footer">

wp_get_post_categories()? I'm not sure what you're trying to get the child category of, as you are querying posts. – m0r7if3r Mar 11 '12 at 15:50