I need a little help : WordPress displays categories with the post, by default sorts them in alphabetical order. However it would be more logical for my blog to have them arranged in a hierarchical way.
For exemple, under my title post I would like to have : Movies -> hitchcock -> Lifeboat, where "Hitchcock" is a child of "Movies" and "Lifeboat" in a child of "Hitchcock".
Instead, I have Hichcock, Lifeboat, Movie. (Since they are sort in alphabetical order.)
I found this piece of code which should do want I want :
<?php $cat_Id = get_the_category($post->ID); $categories = get_category_parents( $cat_Id, TRUE, ' > ' ); $title = get_the_title(); printf( '%1$s <span>in %2$s</span>', get_the_date(), $categories . $title ); ?>
My problem is that I have no idea where to put it... I tried to put it in the loop.php, single.php, archive.php... but nothing changed... :/
Is anyone have an idea where to put this code? Or maybe this code is wrong... I'm not really good at PHP!
Thanks fo any help!