[ Index ]

PHP Cross Reference of WordPress

title

Body

[close]

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

   1  <?php
   2  /**
   3   * The template for displaying posts in the Gallery Post Format on index and archive pages
   4   *
   5   * Learn more: http://codex.wordpress.org/Post_Formats
   6   *
   7   * @package WordPress
   8   * @subpackage Twenty_Eleven
   9   * @since Twenty Eleven 1.0
  10   */
  11  ?>
  12  
  13  <article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
  14      <header class="entry-header">
  15          <hgroup>
  16              <h2 class="entry-title"><a href="<?php the_permalink(); ?>" rel="bookmark"><?php the_title(); ?></a></h2>
  17              <h3 class="entry-format"><?php _e( 'Gallery', 'twentyeleven' ); ?></h3>
  18          </hgroup>
  19  
  20          <div class="entry-meta">
  21              <?php twentyeleven_posted_on(); ?>
  22          </div><!-- .entry-meta -->
  23      </header><!-- .entry-header -->
  24  
  25      <?php if ( is_search() ) : // Only display Excerpts for search pages ?>
  26          <div class="entry-summary">
  27              <?php the_excerpt(); ?>
  28          </div><!-- .entry-summary -->
  29          <?php else : ?>
  30          <div class="entry-content">
  31              <?php if ( post_password_required() ) : ?>
  32                  <?php the_content( __( 'Continue reading <span class="meta-nav">&rarr;</span>', 'twentyeleven' ) ); ?>
  33              <?php else :
  34                  $images = twentyeleven_get_gallery_images();
  35                  if ( $images ) :
  36                      $total_images = count( $images );
  37                      $image = array_shift( $images );
  38              ?>
  39                  <figure class="gallery-thumb">
  40                      <a href="<?php the_permalink(); ?>"><?php echo wp_get_attachment_image( $image, 'thumbnail' ); ?></a>
  41                  </figure><!-- .gallery-thumb -->
  42  
  43                  <p><em><?php printf( _n( 'This gallery contains <a %1$s>%2$s photo</a>.', 'This gallery contains <a %1$s>%2$s photos</a>.', $total_images, 'twentyeleven' ),
  44                          'href="' . esc_url( get_permalink() ) . '" title="' . esc_attr( sprintf( __( 'Permalink to %s', 'twentyeleven' ), the_title_attribute( 'echo=0' ) ) ) . '" rel="bookmark"',
  45                          number_format_i18n( $total_images )
  46                      ); ?></em></p>
  47              <?php endif; // end twentyeleven_get_gallery_images() check ?>
  48              <?php the_excerpt(); ?>
  49          <?php endif; ?>
  50          <?php wp_link_pages( array( 'before' => '<div class="page-link"><span>' . __( 'Pages:', 'twentyeleven' ) . '</span>', 'after' => '</div>' ) ); ?>
  51      </div><!-- .entry-content -->
  52      <?php endif; ?>
  53  
  54      <footer class="entry-meta">
  55          <?php $show_sep = false; ?>
  56          <?php
  57              /* translators: used between list items, there is a space after the comma */
  58              $categories_list = get_the_category_list( __( ', ', 'twentyeleven' ) );
  59              if ( $categories_list ):
  60          ?>
  61          <span class="cat-links">
  62              <?php printf( __( '<span class="%1$s">Posted in</span> %2$s', 'twentyeleven' ), 'entry-utility-prep entry-utility-prep-cat-links', $categories_list );
  63              $show_sep = true; ?>
  64          </span>
  65          <?php endif; // End if categories ?>
  66          <?php
  67              /* translators: used between list items, there is a space after the comma */
  68              $tags_list = get_the_tag_list( '', __( ', ', 'twentyeleven' ) );
  69              if ( $tags_list ):
  70              if ( $show_sep ) : ?>
  71          <span class="sep"> | </span>
  72              <?php endif; // End if $show_sep ?>
  73          <span class="tag-links">
  74              <?php printf( __( '<span class="%1$s">Tagged</span> %2$s', 'twentyeleven' ), 'entry-utility-prep entry-utility-prep-tag-links', $tags_list );
  75              $show_sep = true; ?>
  76          </span>
  77          <?php endif; // End if $tags_list ?>
  78  
  79          <?php if ( comments_open() ) : ?>
  80          <?php if ( $show_sep ) : ?>
  81          <span class="sep"> | </span>
  82          <?php endif; // End if $show_sep ?>
  83          <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>
  84          <?php endif; // End if comments_open() ?>
  85  
  86          <?php edit_post_link( __( 'Edit', 'twentyeleven' ), '<span class="edit-link">', '</span>' ); ?>
  87      </footer><!-- .entry-meta -->
  88  </article><!-- #post-<?php the_ID(); ?> -->


Generated: Sat May 25 03:56:25 2013 Hosted by follow the white rabbit.