[ Index ]

PHP Cross Reference of WordPress Trunk (Updated Daily)

Search

title

Body

[close]

/wp-content/themes/twentynineteen/ -> image.php (source)

   1  <?php
   2  /**
   3   * The template for displaying image attachments
   4   *
   5   * @package WordPress
   6   * @subpackage Twenty_Nineteen
   7   * @since Twenty Nineteen 1.0
   8   */
   9  
  10  get_header();
  11  ?>
  12  
  13      <div id="primary" class="content-area">
  14          <main id="main" class="site-main">
  15  
  16              <?php
  17              // Start the Loop.
  18              while ( have_posts() ) :
  19                  the_post();
  20                  ?>
  21  
  22                  <article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
  23  
  24                      <header class="entry-header">
  25                      <?php the_title( '<h1 class="entry-title">', '</h1>' ); ?>
  26                      </header><!-- .entry-header -->
  27  
  28                      <div class="entry-content">
  29  
  30                          <figure class="entry-attachment wp-block-image">
  31                          <?php
  32                              /**
  33                               * Filters the default twentynineteen image attachment size.
  34                               *
  35                               * @since Twenty Nineteen 1.0
  36                               *
  37                               * @param string $image_size Image size. Default 'large'.
  38                               */
  39                              $image_size = apply_filters( 'twentynineteen_attachment_size', 'full' );
  40  
  41                              echo wp_get_attachment_image( get_the_ID(), $image_size );
  42                          ?>
  43  
  44                              <figcaption class="wp-caption-text"><?php the_excerpt(); ?></figcaption>
  45  
  46                          </figure><!-- .entry-attachment -->
  47  
  48                          <?php
  49                          the_content();
  50                          wp_link_pages(
  51                              array(
  52                                  'before'      => '<div class="page-links"><span class="page-links-title">' . __( 'Pages:', 'twentynineteen' ) . '</span>',
  53                                  'after'       => '</div>',
  54                                  'link_before' => '<span>',
  55                                  'link_after'  => '</span>',
  56                                  /* translators: Hidden accessibility text. */
  57                                  'pagelink'    => '<span class="screen-reader-text">' . __( 'Page', 'twentynineteen' ) . ' </span>%',
  58                                  'separator'   => '<span class="screen-reader-text">, </span>',
  59                              )
  60                          );
  61                          ?>
  62                      </div><!-- .entry-content -->
  63  
  64                      <footer class="entry-footer">
  65                      <?php
  66                          // Retrieve attachment metadata.
  67                          $metadata = wp_get_attachment_metadata();
  68                      if ( $metadata ) {
  69                          printf(
  70                              '<span class="full-size-link"><span class="screen-reader-text">%1$s</span><a href="%2$s">%3$s &times; %4$s</a></span>',
  71                              /* translators: Hidden accessibility text. */
  72                              _x( 'Full size', 'Used before full size attachment link.', 'twentynineteen' ),
  73                              esc_url( wp_get_attachment_url() ),
  74                              absint( $metadata['width'] ),
  75                              absint( $metadata['height'] )
  76                          );
  77                      }
  78                      ?>
  79  
  80                          <?php twentynineteen_entry_footer(); ?>
  81  
  82                      </footer><!-- .entry-footer -->
  83                  </article><!-- #post-<?php the_ID(); ?> -->
  84  
  85                  <?php
  86                  // Parent post navigation.
  87                  the_post_navigation(
  88                      array(
  89                          'prev_text' => _x( '<span class="meta-nav">Published in</span><br><span class="post-title">%title</span>', 'Parent post link', 'twentynineteen' ),
  90                      )
  91                  );
  92  
  93                  // If comments are open or we have at least one comment, load up the comment template.
  94                  if ( comments_open() || get_comments_number() ) {
  95                      comments_template();
  96                  }
  97  
  98                  // End the loop.
  99                  endwhile;
 100              ?>
 101  
 102          </main><!-- .site-main -->
 103      </div><!-- .content-area -->
 104  
 105  <?php
 106  get_footer();


Generated : Sat Nov 23 08:20:01 2024 Cross-referenced by PHPXref