3 * The template for displaying image attachments.
5 * Learn more: http://codex.wordpress.org/Template_Hierarchy
8 * @subpackage Twenty_Thirteen
9 * @since Twenty Thirteen 1.0
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>
20 <div class="entry-meta">
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>';
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 ) ),
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 × %5$s)</a></span>',
37 esc_url( wp_get_attachment_url() ),
38 esc_attr__( 'Link to full-size image', 'twentythirteen' ),
39 __( 'Full resolution', 'twentythirteen' ),
44 edit_post_link( __( 'Edit', 'twentythirteen' ), '<span class="edit-link">', '</span>' );
46 </div><!-- .entry-meta -->
47 </header><!-- .entry-header -->
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">←</span> Previous', 'twentythirteen' ) ); ?></span>
52 <span class="nav-next"><?php next_image_link( false, __( 'Next <span class="meta-nav">→</span>', 'twentythirteen' ) ); ?></span>
53 </nav><!-- #image-navigation -->
55 <div class="entry-attachment">
56 <div class="attachment">
57 <?php twentythirteen_the_attached_image(); ?>
59 <?php if ( has_excerpt() ) : ?>
60 <div class="entry-caption">
61 <?php the_excerpt(); ?>
64 </div><!-- .attachment -->
65 </div><!-- .entry-attachment -->
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 -->
74 </div><!-- .entry-content -->
75 </article><!-- #post -->
77 <?php comments_template(); ?>
79 </div><!-- #content -->
80 </div><!-- #primary -->
82 <?php get_footer(); ?>