This seems like it should be easy to do but I haven't been able to, and cannot find any posts regarding it.
I can display all the categories associated with a product, or the top category, but how do you echo only the lowest / deepest category for a product?
Cat-A [x]
Cat-B [x]
Cat-C [x]
Cat-D [ ]
Cat-E [ ]
Cat-F [ ]
Cat-G [ ]
Cat-H [ ]
If this example is the product's ancestry, all I want to print is "Cat-C".
But I don't want to manually set the category level like other solutions, I want it to always print the lowest child, be the product on the archive page, or single product page.
Any idea of how this can / should be done?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…