Reverse sort the_category so parents come first? (2 posts)

  1. Pete
    Posted 4 years ago #

    Is there an option to reverse the order of categories displayed from the_category currently it's displaying child categories first then parents. I'd like the parents to come first

    Parent, child, another child

  2. jgramp
    Posted 4 years ago #

    See: http://stackoverflow.com/questions/7934337/wordpress-the-category-reverse-order-so-parents-come-first

    If you put the code from the above website into your functions.php file you can refer to it in your templates like this:

    reverse_categories(the_category(' > '));

    I'm using it for a breadcrumb...

Topic Closed

This topic has been closed to new replies.

About this Topic