Topic: List category children
Hello,
I need to list the children of one of my categories. Right now I am using this:
<?php
foreach((get_the_category()) as $childcat) {
if (cat_is_ancestor_of(153, $childcat)) {
echo '<a href="'.get_category_link($childcat->cat_ID).'">';
echo $childcat->cat_name . '</a>';}}
?>But as you can see here: http://oriolesprospects.com/transactions/
There are no commas in between "Aberdeen IronBirdsNorfolk Tides". It should read" "Aberdeen IronBirds, Norfolk Tides"
How do I add commas in between?
I guess I could also use:
<?php the_category(', '); ?>But then I'd need a way to make sure it excludes the parent category and lists just the children. All help appreciated. Thanks!