Support » Fixing WordPress » Show only the subcategory of a post

  • Resolved fodden

    (@fodden)


    Can anyone tell me how to show only the subcategory of a post? I can use the_category to get me both the category and its child, of course. But I can’t find a way to show only the child. (I’m doing this because the page on which the posts appear is a category page, so the parent is obvious.)

    I have searched through the codex and the support forum but haven’t found anything quite on point.

    Any help would be greatly appreciated.

    Cheers,

    Simon

Viewing 2 replies - 1 through 2 (of 2 total)
  • By default, the_category() doesn’t show parents of child categories, unless the post is assigned to the parent category as well.

    Take the parent category off the post and it won’t show that parent as part of the_category() anymore.

    Otto42 thanks a million. So easy and simple — when you know.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Show only the subcategory of a post’ is closed to new replies.