[ Index ]

PHP Cross Reference of WordPress

title

Body

[close]

/wp-content/themes/twentyeleven/ -> content-gallery.php (source)

   1  <?php
   2  /**
   3   * Template for displaying posts in the Gallery Post Format
   4   *
   5   * Used on index and archive pages.
   6   *
   7   * @link https://wordpress.org/support/article/post-formats/
   8   *
   9   * @package WordPress
  10   * @subpackage Twenty_Eleven
  11   * @since Twenty Eleven 1.0
  12   */
  13  ?>
  14  
  15  <article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
  16      <header class="entry-header">
  17          <hgroup>
  18              <h2 class="entry-title"><a href="<?php the_permalink(); ?>" rel="bookmark"><?php the_title(); ?></a></h2>
  19              <h3 class="entry-format"><?php _e( 'Gallery', 'twentyeleven' ); ?></h3>
  20          </hgroup>
  21  
  22          <div class="entry-meta">
  23              <?php twentyeleven_posted_on(); ?>
  24          </div><!-- .entry-meta -->
  25      </header><!-- .entry-header -->
  26  
  27      <?php if ( is_search() ) : // Only display excerpts for search. ?>
  28          <div class="entry-summary">
  29              <?php the_excerpt(); ?>
  30          </div><!-- .entry-summary -->
  31          <?php else : ?>
  32          <div class="entry-content">
  33              <?php if ( post_password_required() ) : ?>
  34                  <?php the_content( __( 'Continue reading <span class="meta-nav">&rarr;</span>', 'twentyeleven' ) ); ?>
  35                  <?php
  36              else :
  37                  $images = twentyeleven_get_gallery_images();
  38                  if ( $images ) :
  39                      $total_images = count( $images );
  40                      $image        = reset( $images );
  41                      ?>
  42                  <figure class="gallery-thumb">
  43                      <a href="<?php the_permalink(); ?>"><?php echo wp_get_attachment_image( $image, 'thumbnail' ); ?></a>
  44      </figure><!-- .gallery-thumb -->
  45  
  46      <p><em>
  47                      <?php
  48                      printf(
  49                          /* translators: 1: Link attributes, 2: Number of photos. */
  50                          _n( 'This gallery contains <a %1$s>%2$s photo</a>.', 'This gallery contains <a %1$s>%2$s photos</a>.', $total_images, 'twentyeleven' ),
  51                          /* translators: %s: Post title. */
  52                          'href="' . esc_url( get_permalink() ) . '" title="' . esc_attr( sprintf( __( 'Permalink to %s', 'twentyeleven' ), the_title_attribute( 'echo=0' ) ) ) . '" rel="bookmark"',
  53                          number_format_i18n( $total_images )
  54                      );
  55                      ?>
  56                      </em></p>
  57                          <?php endif; // End twentyeleven_get_gallery_images() check. ?>
  58                  <?php the_excerpt(); ?>
  59          <?php endif; ?>
  60              <?php
  61              wp_link_pages(
  62                  array(
  63                      'before' => '<div class="page-link"><span>' . __( 'Pages:', 'twentyeleven' ) . '</span>',
  64                      'after'  => '</div>',
  65                  )
  66              );
  67              ?>
  68      </div><!-- .entry-content -->
  69      <?php endif; ?>
  70  
  71      <footer class="entry-meta">
  72          <?php $show_sep = false; ?>
  73  
  74          <?php
  75          /* translators: Used between list items, there is a space after the comma. */
  76          $categories_list = get_the_category_list( __( ', ', 'twentyeleven' ) );
  77  
  78          if ( $categories_list ) :
  79              ?>
  80          <span class="cat-links">
  81              <?php
  82              /* translators: 1: CSS classes, 2: List of categories. */
  83              printf( __( '<span class="%1$s">Posted in</span> %2$s', 'twentyeleven' ), 'entry-utility-prep entry-utility-prep-cat-links', $categories_list );
  84              $show_sep = true;
  85              ?>
  86          </span>
  87          <?php endif; // End if categories. ?>
  88  
  89          <?php
  90          /* translators: Used between list items, there is a space after the comma. */
  91          $tags_list = get_the_tag_list( '', __( ', ', 'twentyeleven' ) );
  92  
  93          if ( $tags_list && ! is_wp_error( $tags_list ) ) :
  94              if ( $show_sep ) :
  95                  ?>
  96          <span class="sep"> | </span>
  97              <?php endif; // End if $show_sep. ?>
  98          <span class="tag-links">
  99              <?php
 100              /* translators: 1: CSS classes, 2: List of tags. */
 101              printf( __( '<span class="%1$s">Tagged</span> %2$s', 'twentyeleven' ), 'entry-utility-prep entry-utility-prep-tag-links', $tags_list );
 102              $show_sep = true;
 103              ?>
 104          </span>
 105          <?php endif; // End if $tags_list. ?>
 106  
 107          <?php if ( comments_open() ) : ?>
 108              <?php if ( $show_sep ) : ?>
 109          <span class="sep"> | </span>
 110          <?php endif; // End if $show_sep. ?>
 111          <span class="comments-link"><?php comments_popup_link( '<span class="leave-reply">' . __( 'Leave a reply', 'twentyeleven' ) . '</span>', __( '<b>1</b> Reply', 'twentyeleven' ), __( '<b>%</b> Replies', 'twentyeleven' ) ); ?></span>
 112          <?php endif; // End if comments_open(). ?>
 113  
 114          <?php edit_post_link( __( 'Edit', 'twentyeleven' ), '<span class="edit-link">', '</span>' ); ?>
 115      </footer><!-- .entry-meta -->
 116  </article><!-- #post-<?php the_ID(); ?> -->


Generated: Tue Nov 24 01:00:03 2020 Cross-referenced by PHPXref 0.7.1