/
image.php
executable file
·99 lines (87 loc) · 2.85 KB
/
image.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
<?php
/**
* The template for displaying image attachments.
*
* @package aventurine
*/
get_header(); ?>
<div id="primary" class="content-area image-attachment">
<main id="main" class="site-main" role="main">
<?php
while ( have_posts() ) :
the_post();
?>
<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
<div class="entry-image">
<?php echo wp_get_attachment_image( get_the_ID(), 'full' ); ?>
</div>
<header class="entry-header">
<?php the_title( '<h1 class="entry-title">', '</h1>' ); ?>
</header><!-- .entry-header -->
<div class="entry-content">
<div class="entry-attachment">
<?php if ( has_excerpt() ) : ?>
<div class="entry-caption">
<?php the_excerpt(); ?>
</div><!-- .entry-caption -->
<?php endif; ?>
</div><!-- .entry-attachment -->
<?php
the_content();
wp_link_pages(
array(
'before' => '<div class="page-links">' . __( 'Pages:', 'aventurine' ),
'after' => '</div>',
)
);
?>
</div><!-- .entry-content -->
<footer class="entry-meta">
<?php
$metadata = wp_get_attachment_metadata();
/* Translators: 1: publish date, 2: image size */
$meta_string = __( 'Published on %1$s at %2$s.', 'aventurine' );
if ( $post->post_parent ) {
/* Translators: 1: publish date, 2: image size, 3: parent post */
$meta_string = __( 'Published on %1$s at %2$s in %3$s.', 'aventurine' );
}
printf(
$meta_string,
sprintf(
'<span class="entry-date"><time class="entry-date" datetime="%1$s">%2$s</time></span>',
esc_attr( get_the_date( 'c' ) ),
esc_html( get_the_date() )
),
sprintf(
'<a href="%1$s">%2$s × %3$s</a>',
esc_url( wp_get_attachment_url() ),
$metadata['width'],
$metadata['height']
),
sprintf(
'<a href="%1$s" rel="gallery">%2$s</a>',
esc_url( get_permalink( $post->post_parent ) ),
get_the_title( $post->post_parent )
)
);
edit_post_link( __( 'Edit', 'aventurine' ), ' <span class="edit-link">', '</span>' );
?>
</footer><!-- .entry-meta -->
</article><!-- #post-## -->
</main><!-- #main -->
</div><!-- #primary -->
</div><!-- #content -->
<?php
if ( comments_open() || '0' != get_comments_number() ) {
comments_template();
}
?>
<div class="content-nav container">
<nav role="navigation" id="image-navigation" class="image-navigation">
<div class="nav-previous"><?php previous_image_link( false, __( 'Previous <span class="meta-nav">→</span>', 'aventurine' ) ); ?></div>
<div class="nav-next"><?php next_image_link( false, __( '<span class="meta-nav">←</span> Next', 'aventurine' ) ); ?></div>
</nav><!-- #image-navigation -->
</div>
<?php endwhile; // end of the loop. ?>
<?php get_sidebar(); ?>
<?php get_footer(); ?>