Simple drop this snippet somewhere in your term template.
<?php the_term_thumbnail() ?>
This works everywhere if you supply a term_id
<?php echo get_term_thumbnail( $term_id ) ?>
Hi Ralph i’m trying to attach the thumbnail to a term list created with this snippet :
$terms = get_terms( 'categorie' );
foreach ( $terms as $term ) {
// The $term is an object, so we don't need to specify the $taxonomy.
$term_link = get_term_link( $term );
// If there was an error, continue to the next term.
if ( is_wp_error( $term_link ) ) {
continue;
}
// We successfully got a link. Print it out.
echo '<li><a href="' . esc_url( $term_link ) . '">' . $term->name . '</a></li>';
;
}
With no success… i don’t know how to call the thumbnail.
could you help ?
thanks a lot 🙂