Hi there,
I am using a bit of code to split my post categories into two sections (only showing the child ones) and am wondering if I am able to limit the output to 3 each (just for the front page) as some posts will have many categories attached to them.
The snippet I am using is below:
<?php foreach((get_the_category()) as $childcat) { if (cat_is_ancestor_of(14, $childcat)) { echo '<a href="/category/',$childcat->category_nicename,'/">',$childcat->cat_name,'</a>', ' '; }}
?>