You appear to be a bot. Output may be restricted
Description
Display an optional post thumbnail.
Wraps the post thumbnail in an anchor element on index views, or a div element when on single views.
Usage
twentyfifteen_post_thumbnail();
Parameters
Returns
void
Source
File name: twentyfifteen/inc/template-tags.php
Lines:
1 to 23 of 23
function twentyfifteen_post_thumbnail() { if ( post_password_required() || is_attachment() || ! has_post_thumbnail() ) { return; } if ( is_singular() ) : ?> <div class="post-thumbnail"> <?php the_post_thumbnail(); ?> </div><!-- .post-thumbnail --> <?php else : ?> <a class="post-thumbnail" href="<?php the_permalink(); ?>" aria-hidden="true"> <?php the_post_thumbnail( 'post-thumbnail', array( 'alt' => get_the_title() ) ); ?> </a> <?php endif; // End is_singular(). }