-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathattachment.php
More file actions
58 lines (48 loc) · 2.01 KB
/
attachment.php
File metadata and controls
58 lines (48 loc) · 2.01 KB
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
<?php get_header(); ?>
<?php global $post; ?>
<main>
<?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
<header>
<h1 class="entry-title">
<?php edit_post_link('edit'); ?>
<?php the_title(); ?>
<span class="meta-sep">|</span>
<a href="<?php echo get_permalink( $post->post_parent ); ?>" title="<?php printf( __( 'Return to %s', 'irohco' ), esc_html( get_the_title( $post->post_parent ), 1 ) ); ?>" rev="attachment">
<span class="meta-nav">← </span>
<?php echo get_the_title( $post->post_parent ); ?>
</a>
</h1>
<?php get_template_part( 'entry', 'meta' ); ?>
</header>
<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
<header>
<nav id="nav-above">
<div class="nav-previous"><?php previous_image_link( false, '←' ); ?></div>
<div class="nav-next"><?php next_image_link( false, '→' ); ?></div>
</nav>
</header>
<section class="entry-content">
<div class="entry-attachment">
<?php if ( wp_attachment_is_image( $post->ID ) ) : $att_image = wp_get_attachment_image_src( $post->ID, "large" ); ?>
<p class="attachment">
<a href="<?php echo wp_get_attachment_url( $post->ID ); ?>" title="<?php the_title(); ?>" rel="attachment">
<img src="<?php echo $att_image[0]; ?>" width="<?php echo $att_image[1]; ?>" height="<?php echo $att_image[2]; ?>" class="attachment-medium" alt="<?php $post->post_excerpt; ?>" />
</a>
</p>
<?php else : ?>
<a href="<?php echo wp_get_attachment_url( $post->ID ); ?>" title="<?php echo esc_html( get_the_title( $post->ID ), 1 ); ?>" rel="attachment">
<?php echo basename( $post->guid ); ?>
</a>
<?php endif; ?>
</div>
<div class="entry-caption">
<?php if ( !empty( $post->post_excerpt ) ) the_excerpt(); ?>
</div>
<?php if ( has_post_thumbnail() ) { the_post_thumbnail(); } ?>
</section>
</article>
<?php comments_template(); ?>
<?php endwhile; endif; ?>
</main>
<?php get_sidebar(); ?>
<?php get_footer(); ?>