Separating sets of categories/subcategories using "the_category"
-
Hi,
I’ve been trying all sorts of methods to try to get multiple categories and their subcategories to be separated in some way that makes it clear which are the Parent categories, but have failed.
I’m using
<?php the_category( $separator, $parents ); ?>
(using ‘multiple’ as the parents string), but if I use anything other than a blank string as the separator (even a space), the separator gets added equally, so that you can’t tell which are the Parent categories, like this:CATEGORY A > Subcategory A1 > Subcategory A2 > CATEGORY B > Subcategory B1 > Subcategory B2
I’d like to either have some sort of indicator that shows a new Parent category has begun (for example, “|” instead of “>”),
CATEGORY A > Subcategory A1 > Subcategory A2 | CATEGORY B > Subcategory B1 > Subcategory B2
or have each set on its own line:
CATEGORY A > Subcategory A1 > Subcategory A2
CATEGORY B > Subcategory B1 > Subcategory B2Any pointers would be appreciated! Thanks!
Ben
- The topic ‘Separating sets of categories/subcategories using "the_category"’ is closed to new replies.