Shucks, just figured it out –
<?php $categories = get_categories("child_of=17"); foreach ($categories as $cat) { ?>
<h2><a href="<?php get_category_link(); ?>"><?php single_cat_title(); ?></a></h2>
<?php endwhile; ?>
<?php }?>
But: the only issue is that get_category_link is wrong here. It just links to the parent. I need that h2 to link into its respective child category. Any clues?
Got it –
<h2><a href="<?php echo get_category_link($cat);?>"><?php single_cat_title(); ?></a></h2>
Heh, actually wait, I’ve got one more question –
I want to use this code in various places throughout my theme, so the “child_of=17” parameter is not going to work. What’s a more generic way to say, “Child of the current page?”
the current category archive page’s category ID is:
get_query_var('cat')
Thanks – but where would I include that?
Also, could anyone tell me how to add the category description for each? I added this-
<?php echo category_description($cat);?>
That only seems to work if I replace $cat with a specific ID number. But I need it to by dynamic. Thanks!
Doh, never mind. The $cat is unnecessary.