Below is part from a WP_Query
loop.
I have two parent categories ABC and 12, and each has a few child categories.
In the first td
I would like to have the category slug from ABC children and in the second from 12 children.
The post may be in one of the two child categories, or both. One from ABC and one from 12, or one from ABC or one from 12.
$inCat = get_the_category(get_the_ID());
echo "<td>".(!empty($inCat[0]->slug) ? $inCat[0]->slug : "")."</td>";
echo "<td>".(!empty($inCat[1]->slug) ? $inCat[1]->slug : "")."</td>";
How can this be accomplished?