This repository has been archived by the owner on Nov 9, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 15
/
image.php
84 lines (67 loc) · 2.57 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
<?php
/**
* The template for displaying image attachment posts.
*
* @link https://developer.wordpress.org/themes/basics/template-hierarchy/#attachment
*
* @var \WP_Post $post
*
* @package popper
*/
// Retrieve attachment metadata.
$metadata = wp_get_attachment_metadata();
get_header(); ?>
<div id="primary" class="content-area">
<main id="main" class="site-main" role="main">
<?php while ( have_posts() ) : the_post(); ?>
<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
<header class="entry-header clear">
<h1 class="entry-title"><?php the_title(); ?></h1>
<div class="entry-meta">
<?php esc_html_e( 'Featured in: ', 'popper' ); ?>
<span class="parent-post-link"><a href="<?php echo get_permalink( $post->post_parent ); ?>" rel="gallery"><?php echo get_the_title( $post->post_parent ); ?></a></span>.
<?php esc_html_e( 'Full size image: ', 'popper' ); ?>
<span class="full-size-link"><a href="<?php echo wp_get_attachment_url(); ?>"><?php echo $metadata[ 'width' ]; ?> × <?php echo $metadata[ 'height' ]; ?></a></span>.
<?php edit_post_link(
esc_html__( 'Edit attachment post', 'popper' ), '<span class="edit-link">', '</span>.'
); ?>
</div><!-- .entry-meta -->
</header><!-- .entry-header -->
<div class="entry-content">
<div class="entry-attachment">
<figure class="image-attachment centered-image<?php if ( has_excerpt() ) {
echo ' alignnone wp-caption';
} ?>">
<?php popper_the_attached_image(); ?>
<?php if ( has_excerpt() ) : ?>
<figcaption class="wp-caption-text">
<?php echo get_the_excerpt(); ?>
</figcaption><!-- .entry-caption -->
<?php endif; ?>
</figure><!-- .wp-caption -->
</div><!-- .entry-attachment -->
<?php
the_content();
wp_link_pages( array(
'before' => '<div class="page-links"><span class="page-links-title">'
. esc_html__( 'Pages:', 'popper' ) . '</span>',
'after' => '</div>',
'link_before' => '<span>',
'link_after' => '</span>',
) );
?>
</div><!-- .entry-content -->
<?php popper_attachment_nav();
// If comments are open or we have at least one comment, load up the comment template
if ( comments_open() || 0 !== (int) get_comments_number() ) :
comments_template();
endif;
?>
</article><!-- #post -->
<?php endwhile; // end of the loop. ?>
</main><!-- #main -->
</div><!-- #primary -->
<?php
get_sidebar();
get_footer();
?>