WordPress.org

Support

Support » How-To and Troubleshooting » How to automatically link to parent and child categories separately?

How to automatically link to parent and child categories separately?

  • spawklz

    @spawklz

    I’ve traversing the net for a solution to this, but I simply cannot seem to get there.

    I use the (top) categories for page titles, and the various pages only display posts from their respective categories. I’d like to – on single post pages have child categories listed and clickable beneath the (top category) title, and on archive pages have the child categories listed underneath the post title:

    single.php:

    [h2](TOP CATEGORY TITLE)
    [h3](CHILD CATEGORIES)
    (POST TITLE, etc.)

    category.php:

    [h2](TOP CATEGORY TITLE)
    (POST TITLE)
    [h3](CHILD CATEGORIES)
    (POST + METADATA, etc.)

    I can’t understand why this should be so difficult. Granted, I’m a complete noob with PHP, but it doesn’t seem too infeasible to me…?

  • The topic ‘How to automatically link to parent and child categories separately?’ is closed to new replies.