get_the_term: cómo mostrar custom taxonomy con link y nombre separado

if (get_the_terms($post->ID, 'tax-dudas')) {
 $tags_list = get_the_terms($post->ID, 'tax-dudas');

 foreach ($tags_list as $taxonomy_term) {
 
 $term_link = get_term_link( $taxonomy_term );
 if ( is_wp_error( $term_link ) ) {
 continue;
 }

 $tags .= '<a href="' . esc_url( $term_link ) . '"><span>' . $taxonomy_term->name . '</span></a>';
 
 
 
 }

 $tags.= '</p>';

Deja un comentario