[ Index ]

PHP Cross Reference of WordPress Trunk (Updated Daily)

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 pages ?>
  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          <?php
  74              /* translators: Used between list items, there is a space after the comma. */
  75              $categories_list = get_the_category_list( __( ', ', 'twentyeleven' ) );
  76          if ( $categories_list ) :
  77              ?>
  78          <span class="cat-links">
  79              <?php
  80              /* translators: 1: CSS classes, 2: List of categories. */
  81              printf( __( '<span class="%1$s">Posted in</span> %2$s', 'twentyeleven' ), 'entry-utility-prep entry-utility-prep-cat-links', $categories_list );
  82              $show_sep = true;
  83              ?>
  84          </span>
  85          <?php endif; // End if categories ?>
  86          <?php
  87              /* translators: Used between list items, there is a space after the comma. */
  88              $tags_list = get_the_tag_list( '', __( ', ', 'twentyeleven' ) );
  89          if ( $tags_list ) :
  90              if ( $show_sep ) :
  91                  ?>
  92          <span class="sep"> | </span>
  93              <?php endif; // End if $show_sep ?>
  94          <span class="tag-links">
  95              <?php
  96              /* translators: 1: CSS classes, 2: List of tags. */
  97              printf( __( '<span class="%1$s">Tagged</span> %2$s', 'twentyeleven' ), 'entry-utility-prep entry-utility-prep-tag-links', $tags_list );
  98              $show_sep = true;
  99              ?>
 100          </span>
 101          <?php endif; // End if $tags_list ?>
 102  
 103          <?php if ( comments_open() ) : ?>
 104              <?php if ( $show_sep ) : ?>
 105          <span class="sep"> | </span>
 106          <?php endif; // End if $show_sep ?>
 107          <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>
 108          <?php endif; // End if comments_open() ?>
 109  
 110          <?php edit_post_link( __( 'Edit', 'twentyeleven' ), '<span class="edit-link">', '</span>' ); ?>
 111      </footer><!-- .entry-meta -->
 112  </article><!-- #post-<?php the_ID(); ?> -->


Generated: Sat Nov 23 20:47:33 2019 Cross-referenced by PHPXref 0.7