I have a category structure that is 5 levels deep. when returning the categories for a post, these categories are not in any particular order. I need to find the last child category for a post.
A:
If you are using them in the loop, you could try this:
<?php the_category("", "single"); ?>
Ref: the_category
===== UPDATED =====
Outside the loop:
<?php the_category("", "single", $post->ID); ?>
PeterWong
2010-10-19 06:09:37
I need to get the child category outside the loop using the post ID.
InnateDev
2010-10-19 06:32:45
Added back the 3rd param :D. The 3rd param is the post's ID, I shouldn't assumed you are in the loop.
PeterWong
2010-10-19 06:42:49