WordPress.org

Ready to get started?Download WordPress

Forums

Retrieving parent and child category in single.php - bug, need help (2 posts)

  1. MACCoutinho
    Member
    Posted 3 years ago #

    Hello everyone,

    I'm using two pieces of code I've found researching the forums and other websites to generate the parent category and the child category of the post I am in within single.php

    The problem is with the sub-category code. When the parent category is alphabetically lower than the child category the child displays fine. But if the parent category is alphabetically superior to the child the child displays as the parent category as well.

    The code is:

    [Code moderated as per the Forum Rules. Please use the pastebin]

    Can you help me out spot what's wrong here?
    I need to order it by hierarchy instead of alphabetically somewhere but I have no idea where.

  2. MACCoutinho
    Member
    Posted 3 years ago #

Topic Closed

This topic has been closed to new replies.

About this Topic