Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

My portal has the following category structure: CategoryLevel1=>CategoryLevel2=>CategoryLevel3=>CategoryLevel4

I assign posts to CategoryLevel4 but I want to show the full category path beneath each post. Each node should be clickable.

Thanks.

share|improve this question

1 Answer 1

up vote 1 down vote accepted

Assuming your categories are in a parent=>child hierarchy as listed(ie category4 is a child of category 3, etc) then this should give you what you're after:

the_category("»", "multiple", $post->ID);
share|improve this answer
    
Thanks. Do I have to assign the post only to the child category or the parent AND child category as well? –  p.a. Sep 28 '12 at 20:24
    
If you just assign the post to category 4, it will show links to the parent category 3, ...2, ...1 as well. –  Ben Sep 28 '12 at 23:03

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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