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
twentyfourteen_post_thumbnail();
Parameters
Returns
void
Source
File name: twentyfourteen/inc/template-tags.php
Lines:
1 to 33 of 33
function twentyfourteen_post_thumbnail() { if ( post_password_required() || is_attachment() || ! has_post_thumbnail() ) { return; } if ( is_singular() ) : ?> <div class="post-thumbnail"> <?php if ( ( ! is_active_sidebar( 'sidebar-2' ) || is_page_template( 'page-templates/full-width.php' ) ) ) { the_post_thumbnail( 'twentyfourteen-full-width' ); } else { the_post_thumbnail(); } ?> </div> <?php else : ?> <a class="post-thumbnail" href="<?php the_permalink(); ?>" aria-hidden="true"> <?php if ( ( ! is_active_sidebar( 'sidebar-2' ) || is_page_template( 'page-templates/full-width.php' ) ) ) { the_post_thumbnail( 'twentyfourteen-full-width' ); } else { the_post_thumbnail( 'post-thumbnail', array( 'alt' => get_the_title() ) ); } ?> </a> <?php endif; // End is_singular(). }