author | ymh <ymh.work@gmail.com> |
Mon, 14 Oct 2019 18:30:03 +0200 | |
changeset 10 | 372f2766ea20 |
parent 7 | cf61fcea0001 |
permissions | -rw-r--r-- |
0 | 1 |
<?php |
2 |
/** |
|
3 |
* The template for displaying image attachments |
|
4 |
* |
|
10 | 5 |
* @link https://developer.wordpress.org/themes/basics/template-hierarchy/ |
0 | 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"> |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
16 |
|
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
17 |
<?php |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
18 |
// Start the Loop. |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
19 |
while ( have_posts() ) : |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
20 |
the_post(); |
10 | 21 |
?> |
0 | 22 |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
23 |
<article id="post-<?php the_ID(); ?>" <?php post_class( 'image-attachment' ); ?>> |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
24 |
<header class="entry-header"> |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
25 |
<h1 class="entry-title"><?php the_title(); ?></h1> |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
26 |
|
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
27 |
<div class="entry-meta"> |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
28 |
<?php |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
29 |
$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' ); |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
30 |
$post_title = get_the_title( $post->post_parent ); |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
31 |
if ( empty( $post_title ) || 0 == $post->post_parent ) { |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
32 |
$published_text = '<span class="attachment-meta"><time class="entry-date" datetime="%1$s">%2$s</time></span>'; |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
33 |
} |
0 | 34 |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
35 |
printf( |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
36 |
$published_text, |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
37 |
esc_attr( get_the_date( 'c' ) ), |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
38 |
esc_html( get_the_date() ), |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
39 |
esc_url( get_permalink( $post->post_parent ) ), |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
40 |
esc_attr( strip_tags( $post_title ) ), |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
41 |
$post_title |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
42 |
); |
0 | 43 |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
44 |
$metadata = wp_get_attachment_metadata(); |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
45 |
printf( |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
46 |
'<span class="attachment-meta full-size-link"><a href="%1$s" title="%2$s">%3$s (%4$s × %5$s)</a></span>', |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
47 |
esc_url( wp_get_attachment_url() ), |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
48 |
esc_attr__( 'Link to full-size image', 'twentythirteen' ), |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
49 |
__( 'Full resolution', 'twentythirteen' ), |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
50 |
$metadata['width'], |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
51 |
$metadata['height'] |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
52 |
); |
0 | 53 |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
54 |
edit_post_link( __( 'Edit', 'twentythirteen' ), '<span class="edit-link">', '</span>' ); |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
55 |
?> |
0 | 56 |
</div><!-- .entry-meta --> |
57 |
</header><!-- .entry-header --> |
|
58 |
||
59 |
<div class="entry-content"> |
|
60 |
<nav id="image-navigation" class="navigation image-navigation" role="navigation"> |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
61 |
<span class="nav-previous"><?php previous_image_link( false, __( '<span class="meta-nav">←</span> Previous', 'twentythirteen' ) ); ?></span> |
0 | 62 |
<span class="nav-next"><?php next_image_link( false, __( 'Next <span class="meta-nav">→</span>', 'twentythirteen' ) ); ?></span> |
63 |
</nav><!-- #image-navigation --> |
|
64 |
||
65 |
<div class="entry-attachment"> |
|
66 |
<div class="attachment"> |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
67 |
<?php twentythirteen_the_attached_image(); ?> |
0 | 68 |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
69 |
<?php if ( has_excerpt() ) : ?> |
0 | 70 |
<div class="entry-caption"> |
71 |
<?php the_excerpt(); ?> |
|
72 |
</div> |
|
73 |
<?php endif; ?> |
|
74 |
</div><!-- .attachment --> |
|
75 |
</div><!-- .entry-attachment --> |
|
76 |
||
77 |
<?php if ( ! empty( $post->post_content ) ) : ?> |
|
78 |
<div class="entry-description"> |
|
79 |
<?php the_content(); ?> |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
80 |
<?php |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
81 |
wp_link_pages( |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
82 |
array( |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
83 |
'before' => '<div class="page-links">' . __( 'Pages:', 'twentythirteen' ), |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
84 |
'after' => '</div>', |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
85 |
) |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
86 |
); |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
87 |
?> |
0 | 88 |
</div><!-- .entry-description --> |
89 |
<?php endif; ?> |
|
90 |
||
91 |
</div><!-- .entry-content --> |
|
92 |
</article><!-- #post --> |
|
93 |
||
10 | 94 |
<?php comments_template(); ?> |
0 | 95 |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
96 |
<?php endwhile; // End the loop. ?> |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
97 |
|
0 | 98 |
</div><!-- #content --> |
99 |
</div><!-- #primary --> |
|
100 |
||
5 | 101 |
<?php get_footer(); ?> |