Salve,
ho la necessità di mostrare in ordine gerarchico (padre – figlio) e alfabetico le category taxonomy del mio custom post.
esempio:
AAA (categoria genitore)
AAA (categotia figlio)
BBB (categotia figlio)
CCC (categotia figlio)
per ora con questo codice, sono riuscito a stampare le category taxonomy solo in ordine alfabetico (non tiene conto dell’ordine genitore figlio)
$terms = get_the_terms( $post->ID, 'casestudies_category' );
if ( $terms && ! is_wp_error( $terms ) ) :
$draught_links = array();
foreach ( $terms as $term ) {
$draught_links[] = $term->name;
echo $term->name. "";
}
qualcuno può aiutarmi
Grazie