my-category の子の 1 人のスラッグと ID を取得しています。
すべての子からナメクジと ID を取得する方法がわかりません。
$incat = get_category_by_slug("my-category");
foreach((get_the_category()) as $inchild):
if (cat_is_ancestor_of($incat, $inchild)):
$my_category_name = strtolower( str_replace(" ", "-", $inchild->slug) );
$my_category_id = $inchild->cat_ID;
endif;
endforeach;