-
Notifications
You must be signed in to change notification settings - Fork 1
/
attachment.php
66 lines (44 loc) · 2.05 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
<?php
// attachment page for theme Appeal
get_header(); ?>
<div id="content" class="row">
<div id="main" class="col-xs-12 col-sm-8 col-md-9 col-lg-9" role="main">
<?php
if ( have_posts() ) : while ( have_posts() ) : the_post();
?>
<h1><?php the_title(); ?></h1>
<div class="entry-attachment">
<?php if ( wp_attachment_is_image( $post->id ) ) :
$att_image = wp_get_attachment_image_src( $post->id, "full"); ?>
<p class="attachment">
<a href="<?php echo esc_attr( wp_get_attachment_url( $post->id ) ); ?>"
title="<?php the_title_attribute(); ?>"
rel="attachment"><img src="<?php echo esc_attr($att_image[0]);?>"
width="<?php echo esc_attr($att_image[1]);?>"
height="<?php echo esc_attr($att_image[2]);?>"
class="img-responsive"
alt="<?php the_title_attribute(); ?>" /></a>
</p>
<?php else : ?>
<a href="<?php echo esc_url(wp_get_attachment_url($post->ID)) ?>"
title="<?php echo esc_attr(get_the_title($post->ID), 1 ) ?>"
rel="attachment"><?php printf( esc_url( basename($post->guid) ) ); ?></a>
<?php endif; ?>
<hr>
<?php the_excerpt(); ?>
</div>
<footer class="meta-footer">
<?php get_template_part('part', 'metadata' ); ?>
</footer>
<?php comments_template(); ?>
<?php endwhile; ?>
<?php else : ?>
<?php get_template_part( 'nothing' ); ?>
<?php endif; ?>
<?php get_template_part( 'nav', 'content' ); ?>
</div>
<div class="col-xs-12 col-sm-4 col-md-3 col-lg-3">
<?php get_sidebar( 'right' ); ?>
</div>
</div><!-- ends #content .row -->
<?php get_footer(); ?>