get thumbnail code example
Example 1: youtube video image
<!-- thumbnail -->
https://img.youtube.com/vi/<insert-youtube-video-id-here>/mqdefault.jpg
<!-- Others -->
https://img.youtube.com/vi/<insert-youtube-video-id-here>/default.jpg
https://img.youtube.com/vi/<insert-youtube-video-id-here>/0.jpg
https://img.youtube.com/vi/<insert-youtube-video-id-here>/1.jpg
https://img.youtube.com/vi/<insert-youtube-video-id-here>/2.jpg
https://img.youtube.com/vi/<insert-youtube-video-id-here>/3.jpg
Example 2: get term thumbnail
$image_id = get_term_meta( $term->term_id, 'thumbnail_id', true );
$post_thumbnail_img = wp_get_attachment_image_src( $image_id, 'large' );
echo '<img src="' . $post_thumbnail_img[0] . '" alt="' . $term->name . '" />';