-
Notifications
You must be signed in to change notification settings - Fork 2
/
attachment.php
executable file
·89 lines (72 loc) · 2.49 KB
/
attachment.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
<?php
/**
* The attachment template.
*
* @package Hellish Simplicity
* @since Hellish Simplicity 1.6
*/
get_header(); ?>
<div id="content-area">
<div id="site-content" role="main"><?php
if ( have_posts() ) {
// Start of the Loop
while ( have_posts() ) {
the_post();
?>
<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
<header class="entry-header">
<h1 class="entry-title"><a href="<?php the_permalink(); ?>" title="<?php echo esc_attr( sprintf( __( 'Permalink to %s', 'hellish-simplicity' ), the_title_attribute( 'echo=0' ) ) ); ?>" rel="bookmark"><?php the_title(); ?></a></h1>
<div class="entry-meta"><?php
// Get attachment
$metadata = wp_get_attachment_metadata();
printf( ' <span class="attachment-meta full-size-link"><a href="%1$s" title="%2$s">%3$s (%4$s × %5$s)</a></span>',
esc_url( wp_get_attachment_url() ),
esc_attr__( 'Link to full-size image', 'hellish-simplicity' ),
esc_html__( 'Full resolution', 'hellish-simplicity' ),
absint( $metadata['width'] ),
absint( $metadata['height'] )
);
// Edit link
edit_post_link( __( 'Edit', 'hellish-simplicity' ), '<span class="sep"> | </span><span class="edit-link">', '</span>' );
?>
</div><!-- .entry-meta -->
</header><!-- .entry-header -->
<div class="entry-attachment">
<div class="attachment"><?php
$post = get_post();
printf( '<a href="%1$s" title="%2$s" rel="attachment">%3$s</a>',
esc_url( wp_get_attachment_url() ),
esc_attr( the_title_attribute( array( 'echo' => false ) ) ),
wp_get_attachment_image( $post->ID, 'hellish-simplicity-attachment-page' )
);
?>
</div><!-- .attachment -->
</div><!-- .entry-attachment -->
<?php if ( has_excerpt() ) : ?>
<div class="entry-caption">
<?php the_excerpt(); ?>
</div>
<?php endif; ?>
<?php if ( ! empty( $post->post_content ) ) : ?>
<div class="entry-description"><?php
the_content();
wp_link_pages(
array(
'before' => '<div class="page-links">' . esc_html__( 'Pages:', 'hellish-simplicity' ),
'after' => '</div>'
)
);
?>
</div><!-- .entry-description -->
<?php endif; ?>
</article><!-- #post-<?php the_ID(); ?> --><?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( '', true );
}
}
}
?>
</div><!-- #site-content -->
</div><!-- #content-area -->
<?php get_footer(); ?>