wp/wp-content/themes/twentyfourteen/image.php
changeset 8 c7c34916027a
parent 7 cf61fcea0001
child 9 177826044cd9
equal deleted inserted replaced
7:cf61fcea0001 8:c7c34916027a
     1 <?php
       
     2 /**
       
     3  * The template for displaying image attachments
       
     4  *
       
     5  * @package WordPress
       
     6  * @subpackage Twenty_Fourteen
       
     7  * @since Twenty Fourteen 1.0
       
     8  */
       
     9 
       
    10 // Retrieve attachment metadata.
       
    11 $metadata = wp_get_attachment_metadata();
       
    12 
       
    13 get_header();
       
    14 ?>
       
    15 
       
    16 	<section id="primary" class="content-area image-attachment">
       
    17 		<div id="content" class="site-content" role="main">
       
    18 
       
    19 	<?php
       
    20 		// Start the Loop.
       
    21 	while ( have_posts() ) :
       
    22 		the_post();
       
    23 	?>
       
    24 		<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
       
    25 			<header class="entry-header">
       
    26 				<?php the_title( '<h1 class="entry-title">', '</h1>' ); ?>
       
    27 
       
    28 				<div class="entry-meta">
       
    29 
       
    30 					<span class="entry-date"><time class="entry-date" datetime="<?php echo esc_attr( get_the_date( 'c' ) ); ?>"><?php echo esc_html( get_the_date() ); ?></time></span>
       
    31 
       
    32 					<span class="full-size-link"><a href="<?php echo esc_url( wp_get_attachment_url() ); ?>"><?php echo esc_html( $metadata['width'] ); ?> &times; <?php echo esc_html( $metadata['height'] ); ?></a></span>
       
    33 
       
    34 					<span class="parent-post-link"><a href="<?php echo esc_url( get_permalink( $post->post_parent ) ); ?>" rel="gallery"><?php echo get_the_title( $post->post_parent ); ?></a></span>
       
    35 					<?php edit_post_link( __( 'Edit', 'twentyfourteen' ), '<span class="edit-link">', '</span>' ); ?>
       
    36 				</div><!-- .entry-meta -->
       
    37 			</header><!-- .entry-header -->
       
    38 
       
    39 			<div class="entry-content">
       
    40 				<div class="entry-attachment">
       
    41 					<div class="attachment">
       
    42 						<?php twentyfourteen_the_attached_image(); ?>
       
    43 					</div><!-- .attachment -->
       
    44 
       
    45 					<?php if ( has_excerpt() ) : ?>
       
    46 						<div class="entry-caption">
       
    47 							<?php the_excerpt(); ?>
       
    48 						</div><!-- .entry-caption -->
       
    49 						<?php endif; ?>
       
    50 				</div><!-- .entry-attachment -->
       
    51 
       
    52 				<?php
       
    53 					the_content();
       
    54 					wp_link_pages(
       
    55 						array(
       
    56 							'before'      => '<div class="page-links"><span class="page-links-title">' . __( 'Pages:', 'twentyfourteen' ) . '</span>',
       
    57 							'after'       => '</div>',
       
    58 							'link_before' => '<span>',
       
    59 							'link_after'  => '</span>',
       
    60 						)
       
    61 					);
       
    62 				?>
       
    63 				</div><!-- .entry-content -->
       
    64 			</article><!-- #post-## -->
       
    65 
       
    66 			<nav id="image-navigation" class="navigation image-navigation">
       
    67 				<div class="nav-links">
       
    68 				<?php previous_image_link( false, '<div class="previous-image">' . __( 'Previous Image', 'twentyfourteen' ) . '</div>' ); ?>
       
    69 				<?php next_image_link( false, '<div class="next-image">' . __( 'Next Image', 'twentyfourteen' ) . '</div>' ); ?>
       
    70 				</div><!-- .nav-links -->
       
    71 			</nav><!-- #image-navigation -->
       
    72 
       
    73 			<?php comments_template(); ?>
       
    74 
       
    75 		<?php endwhile; // end of the loop. ?>
       
    76 
       
    77 		</div><!-- #content -->
       
    78 	</section><!-- #primary -->
       
    79 
       
    80 <?php
       
    81 get_sidebar();
       
    82 get_footer();