Post Loop Category first show parent then child
The following code will print out all the top-level categories first and then all the non-top-level categories, if that’s what u wanted. <?php $categories = get_the_category( get_the_ID() ); if( $categories ){ $output = “”; //display all the top-level categories first foreach ($categories as $category) { if( !$category->parent ){ $output .= ‘<a href=”‘ . esc_url( get_category_link( … Read more