Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter dianat

    (@dianat)

    Ah, I just had to nest them properly:

    <span class="cat-links">
    	<?php
    	foreach((get_the_category()) as $childcat) {
    	if (cat_is_ancestor_of(3, $childcat)) {
    	echo 'Color: '. '<a href="'.get_category_link($childcat->cat_ID).'">';
     echo $childcat->cat_name . '</a>';
    	}
    	if (cat_is_ancestor_of(10, $childcat)) {
    	echo 'Shape: '. '<a href="'.get_category_link($childcat->cat_ID).'">';
     echo $childcat->cat_name . '</a>';
    	}
    	}
    	?>
    </span>
    <?php endif; // End if categories ?>
    Thread Starter dianat

    (@dianat)

    Last step, need them displayed in parent ID order. By default, content is displayed by Child alpha order. Changed get_the_category() to get_the_category('orderby=ID&order=ASC'). No joy.

    Any ideas?

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Displaying multiple child categories of different parents’ is closed to new replies.