0

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.

1

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);
| 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 HartLenn Sep 28 '12 at 23:03

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.