[ Index ]

PHP Cross Reference of WordPress Trunk (Updated Daily)

Search

title

Body

[close]

/wp-content/themes/twentytwenty/template-parts/ -> featured-image.php (source)

   1  <?php
   2  /**
   3   * Displays the featured image
   4   *
   5   * @package WordPress
   6   * @subpackage Twenty_Twenty
   7   * @since Twenty Twenty 1.0
   8   */
   9  
  10  if ( has_post_thumbnail() && ! post_password_required() ) {
  11  
  12      $featured_media_inner_classes = '';
  13  
  14      // Make the featured media thinner on archive pages.
  15      if ( ! is_singular() ) {
  16          $featured_media_inner_classes .= ' medium';
  17      }
  18      ?>
  19  
  20      <figure class="featured-media">
  21  
  22          <div class="featured-media-inner section-inner<?php echo $featured_media_inner_classes; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- static output ?>">
  23  
  24              <?php
  25              the_post_thumbnail();
  26  
  27              $caption = get_the_post_thumbnail_caption();
  28  
  29              if ( $caption ) {
  30                  ?>
  31  
  32                  <figcaption class="wp-caption-text"><?php echo wp_kses_post( $caption ); ?></figcaption>
  33  
  34                  <?php
  35              }
  36              ?>
  37  
  38          </div><!-- .featured-media-inner -->
  39  
  40      </figure><!-- .featured-media -->
  41  
  42      <?php
  43  }


Generated : Fri Nov 15 08:20:01 2024 Cross-referenced by PHPXref