0

I'm trying to show post categories for some breadcrumbs. At the moment, I have this:

the_category(' / ', 'multiple');

But for some reason, it is stating the parent category twice (I only want parent > child):

FASHION / DAILY FASHION CANDY / FASHION

It should really be:

FASHION / DAILY FASHION CANDY

Would anyone know why it's doing this, and how to change it?

1

If you select both categories for the post the_category() will display both and using multiple will make the child category display the parent relationship, so you will have the parent twice. If you want to display a link to the parent category and a link to child category select only the child category for the post and use the_category(' / ', 'multiple');.

  • How would I select only the child category for the post — remove the 'fashion' in the categories tickbox? – tmyie Mar 24 '14 at 12:30
0

Have you tried using 'single' instead of 'multiple'? (I guess the display of 'multiple' is a bit misleading. In your example I think the first / is a marker for the hiearchy. The second / is for dividing alternatives.)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.