• AFQ

    (@afq)


    I am unable to understand how WP fills up the array which get_the_category function returns.

    This is the hierarchy of categories in two cases:

    Cat 1 > Cat 2 > Cat 3

    Cat 1 > Cat 2

    In the first case, the 0 index of the array contains Cat 2 and in the second case, 0 index has Cat 1.

    Can anyone explain how it works? Thanks.

The topic ‘Need help understanding get_the_category function parent-child order?’ is closed to new replies.