[ Index ]

PHP Cross Reference of WordPress

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" role="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                               * Filter 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                                  'pagelink'    => '<span class="screen-reader-text">' . __( 'Page', 'twentyfifteen' ) . ' </span>%',
  66                                  'separator'   => '<span class="screen-reader-text">, </span>',
  67                              )
  68                          );
  69                          ?>
  70                      </div><!-- .entry-content -->
  71  
  72                      <footer class="entry-footer">
  73                      <?php twentyfifteen_entry_meta(); ?>
  74                          <?php edit_post_link( __( 'Edit', 'twentyfifteen' ), '<span class="edit-link">', '</span>' ); ?>
  75                      </footer><!-- .entry-footer -->
  76  
  77                  </article><!-- #post-<?php the_ID(); ?> -->
  78  
  79                  <?php
  80                  // If comments are open or we have at least one comment, load up the comment template
  81                  if ( comments_open() || get_comments_number() ) :
  82                      comments_template();
  83                      endif;
  84  
  85                  // Previous/next post navigation.
  86                  the_post_navigation(
  87                      array(
  88                          'prev_text' => _x( '<span class="meta-nav">Published in</span><span class="post-title">%title</span>', 'Parent post link', 'twentyfifteen' ),
  89                      )
  90                  );
  91  
  92                  // End the loop.
  93                  endwhile;
  94              ?>
  95  
  96          </main><!-- .site-main -->
  97      </div><!-- .content-area -->
  98  
  99  <?php get_footer(); ?>


Generated: Mon Oct 21 01:00:03 2019 Cross-referenced by PHPXref 0.7.1