wp/wp-content/themes/twentythirteen/image.php
changeset 0 d970ebf37754
child 5 5e2f62d02dcd
equal deleted inserted replaced
-1:000000000000 0:d970ebf37754
       
     1 <?php
       
     2 /**
       
     3  * The template for displaying image attachments
       
     4  *
       
     5  * @link http://codex.wordpress.org/Template_Hierarchy
       
     6  *
       
     7  * @package WordPress
       
     8  * @subpackage Twenty_Thirteen
       
     9  * @since Twenty Thirteen 1.0
       
    10  */
       
    11 
       
    12 get_header(); ?>
       
    13 
       
    14 	<div id="primary" class="content-area">
       
    15 		<div id="content" class="site-content" role="main">
       
    16 			<article id="post-<?php the_ID(); ?>" <?php post_class( 'image-attachment' ); ?>>
       
    17 				<header class="entry-header">
       
    18 					<h1 class="entry-title"><?php the_title(); ?></h1>
       
    19 
       
    20 					<div class="entry-meta">
       
    21 						<?php
       
    22 							$published_text = __( '<span class="attachment-meta">Published on <time class="entry-date" datetime="%1$s">%2$s</time> in <a href="%3$s" title="Return to %4$s" rel="gallery">%5$s</a></span>', 'twentythirteen' );
       
    23 							$post_title = get_the_title( $post->post_parent );
       
    24 							if ( empty( $post_title ) || 0 == $post->post_parent )
       
    25 								$published_text = '<span class="attachment-meta"><time class="entry-date" datetime="%1$s">%2$s</time></span>';
       
    26 
       
    27 							printf( $published_text,
       
    28 								esc_attr( get_the_date( 'c' ) ),
       
    29 								esc_html( get_the_date() ),
       
    30 								esc_url( get_permalink( $post->post_parent ) ),
       
    31 								esc_attr( strip_tags( $post_title ) ),
       
    32 								$post_title
       
    33 							);
       
    34 
       
    35 							$metadata = wp_get_attachment_metadata();
       
    36 							printf( '<span class="attachment-meta full-size-link"><a href="%1$s" title="%2$s">%3$s (%4$s &times; %5$s)</a></span>',
       
    37 								esc_url( wp_get_attachment_url() ),
       
    38 								esc_attr__( 'Link to full-size image', 'twentythirteen' ),
       
    39 								__( 'Full resolution', 'twentythirteen' ),
       
    40 								$metadata['width'],
       
    41 								$metadata['height']
       
    42 							);
       
    43 
       
    44 							edit_post_link( __( 'Edit', 'twentythirteen' ), '<span class="edit-link">', '</span>' );
       
    45 						?>
       
    46 					</div><!-- .entry-meta -->
       
    47 				</header><!-- .entry-header -->
       
    48 
       
    49 				<div class="entry-content">
       
    50 					<nav id="image-navigation" class="navigation image-navigation" role="navigation">
       
    51 						<span class="nav-previous"><?php previous_image_link( false, __( '<span class="meta-nav">&larr;</span> Previous', 'twentythirteen' ) ); ?></span>
       
    52 						<span class="nav-next"><?php next_image_link( false, __( 'Next <span class="meta-nav">&rarr;</span>', 'twentythirteen' ) ); ?></span>
       
    53 					</nav><!-- #image-navigation -->
       
    54 
       
    55 					<div class="entry-attachment">
       
    56 						<div class="attachment">
       
    57 							<?php twentythirteen_the_attached_image(); ?>
       
    58 
       
    59 							<?php if ( has_excerpt() ) : ?>
       
    60 							<div class="entry-caption">
       
    61 								<?php the_excerpt(); ?>
       
    62 							</div>
       
    63 							<?php endif; ?>
       
    64 						</div><!-- .attachment -->
       
    65 					</div><!-- .entry-attachment -->
       
    66 
       
    67 					<?php if ( ! empty( $post->post_content ) ) : ?>
       
    68 					<div class="entry-description">
       
    69 						<?php the_content(); ?>
       
    70 						<?php wp_link_pages( array( 'before' => '<div class="page-links">' . __( 'Pages:', 'twentythirteen' ), 'after' => '</div>' ) ); ?>
       
    71 					</div><!-- .entry-description -->
       
    72 					<?php endif; ?>
       
    73 
       
    74 				</div><!-- .entry-content -->
       
    75 			</article><!-- #post -->
       
    76 
       
    77 			<?php comments_template(); ?>
       
    78 
       
    79 		</div><!-- #content -->
       
    80 	</div><!-- #primary -->
       
    81 
       
    82 <?php get_footer(); ?>