How to order categories as parent > child category?
-
Hello!
I’m using this code to make something like a breadcrumbs, in my posts pages, excluding some categories in the same time (1, 3, 86).
<?php foreach((get_the_category()) as $cat) { if (!($cat->cat_ID==’1′ || $cat->cat_ID==’3′ || $cat->cat_ID==’86’)) echo ‘category_nicename . ‘/”>’. $cat->cat_name . ‘‘ . ‘, ‘; } ?>
Now, in this row, the categories are showing alphabetically. How can I make them show in the order of parent > child category?
Thank you very much!
- The topic ‘How to order categories as parent > child category?’ is closed to new replies.