• Resolved wp

    (@voipben)


    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 B2

    Any pointers would be appreciated! Thanks!
    Ben

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

    (@voipben)

    Hi again,
    I found another way of achieving this. However, I’d love to know if anyone knows of possible modifications to the_category syntax along the lines of what I was trying to do.
    Best,
    Ben

    Thread Starter wp

    (@voipben)

    Closing the thread…

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Separating sets of categories/subcategories using "the_category"’ is closed to new replies.