-
Notifications
You must be signed in to change notification settings - Fork 1
/
image.php
86 lines (75 loc) · 3.09 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
<?php
/**
* The template for displaying image attachments.
*
* @package Figure/Ground
*/
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(); ?>>
<footer class="entry-meta">
<ul>
<li class="posted-on">
<a class="entry-date"><time class="entry-date" datetime="<?php echo esc_attr( get_the_date( 'c' ) ); ?>"><?php echo esc_html( get_the_date( 'm d y' ) ); ?></time></a>
</li>
<?php $metadata = wp_get_attachment_metadata(); ?>
<li class="image-size">
<a href="<?php echo esc_url( wp_get_attachment_url() ); ?>" title="Link to full-size image"><?php echo $metadata['width']; ?> × <?php echo $metadata['height']; ?></a>
</li>
<li class="posted-in">
<a href="<?php echo esc_url( get_permalink( $post->post_parent ) ); ?>" title="<?php echo __( 'Return to ', 'figureground' ) . esc_attr( strip_tags( get_the_title( $post->post_parent ) ) ); ?>" rel="gallery"><?php echo get_the_title( $post->post_parent ); ?></a>
</li>
<?php
if ( ! post_password_required() && ( comments_open() || '0' != get_comments_number() ) ) {
$class = 'comments-link';
if ( 0 != get_comments_number() ) {
$class .= ' has-comments';
}
echo '<li class="' . $class . '">';
comments_popup_link( '', '1', '%' );
echo '</li>';
}
?>
<?php edit_post_link( __( 'Edit', 'figureground' ), '<li class="edit-link">', '</li>' ); ?>
</ul>
</footer><!-- .entry-meta -->
<header class="entry-header">
<?php the_title( '<h1 class="entry-title">', '</h1>' ); ?>
</header><!-- .entry-header -->
<div class="attachment">
<?php figureground_the_attached_image(); ?>
</div><!-- .attachment -->
<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:', 'figureground' ),
'after' => '</div>',
) );
?>
<nav role="navigation" id="image-navigation" class="image-navigation">
<div class="nav-previous"><?php previous_image_link( false, __( '<span class="meta-nav">←</span> Previous', 'figureground' ) ); ?></div>
<div class="nav-next"><?php next_image_link( false, __( 'Next <span class="meta-nav">→</span>', 'figureground' ) ); ?></div>
</nav><!-- #image-navigation -->
</div><!-- .entry-content -->
</article><!-- #post-## -->
<?php
// If comments are open or we have at least one comment, load up the comment template
if ( comments_open() || '0' != get_comments_number() ) {
comments_template();
}
?>
<?php endwhile; // end of the loop. ?>
</main><!-- #main -->
</div><!-- #primary -->
<?php get_footer(); ?>