[ Index ]

PHP Cross Reference of WordPress Trunk (Updated Daily)

Search

title

Body

[close]

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

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


Generated : Thu Mar 28 08:20:01 2024 Cross-referenced by PHPXref