wp-content/themes/twentytwentyone/inc/template-tags.php:179Displays an optional post thumbnail.
void function twenty_twenty_one_post_thumbnail() { if ( ! twenty_twenty_one_can_show_post_thumbnail() ) { return; } ?> <?php if ( is_singular() ) : ?> <figure class="post-thumbnail"> <?php // Lazy-loading attributes should be skipped for thumbnails since they are immediately in the viewport. the_post_thumbnail( 'post-thumbnail', array( 'loading' => false ) ); ?> <?php if ( wp_get_attachment_caption( get_post_thumbnail_id() ) ) : ?> <figcaption class="wp-caption-text"><?php echo wp_kses_post( wp_get_attachment_caption( get_post_thumbnail_id() ) ); ?></figcaption> <?php endif; ?> </figure><!-- .post-thumbnail --> <?php else : ?> <figure class="post-thumbnail"> <a class="post-thumbnail-inner alignwide" href="<?php the_permalink(); ?>" aria-hidden="true" tabindex="-1"> <?php the_post_thumbnail( 'post-thumbnail' ); ?> </a> <?php if ( wp_get_attachment_caption( get_post_thumbnail_id() ) ) : ?> <figcaption class="wp-caption-text"><?php echo wp_kses_post( wp_get_attachment_caption( get_post_thumbnail_id() ) ); ?></figcaption> <?php endif; ?> </figure><!-- .post-thumbnail --> <?php endif; ?> <?php }Introduced in Twenty Twenty-One 1.0. Unchanged from 6.7.7 through 7.1.0.
Signature, return type and hooks compared across 5 parsed releases.
src/wp-content/themes/twentytwentyone/inc/template-tags.php, and regenerated for each WordPress release so it tracks the code rather than a snapshot of it.