-
Notifications
You must be signed in to change notification settings - Fork 0
/
attachment.php
80 lines (60 loc) · 2.79 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
<?php
/**
* Attachment template used for multi-purpose attachments, images, files, etc.
* @subpackage Scheduler theme
* @since 1.8.0
*/
get_header(); ?>
<section id="content" role="main">
<?php if (have_posts() ) { ?>
<?php while ( have_posts() ) { the_post(); ?>
<div id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
<header class="postmetadata" role="content info">
<h2 class="attach-viewer"><em><?php esc_html_e( 'Attachment Viewer: ', 'scheduler' ); ?></em> <?php the_title(); ?></h2>
<p> <?php echo get_the_author(); ?> - <span><?php the_time('l, F jS, Y'); ?></span>
</header>
<article class="entry">
<div class="content">
<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 class="img-responsive"
href="<?php echo esc_url( wp_get_attachment_url( $post->id ) ); ?>"
title="<?php the_title_attribute(); ?>">
<img src="<?php echo esc_url($att_image[0]);?>"
alt="<?php the_title_attribute(); ?>"
width="<?php echo esc_attr($att_image[1]);?>"
height="<?php echo esc_attr($att_image[2]);?>" /><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 ) ?>">
<?php print( esc_url_raw( basename($post->guid) ) ); ?></a>
<?php endif; ?>
<hr>
<?php the_content(); ?>
</div>
<footer class="scheduler-entry-footer">
<?php if( has_tag() && 'post_tag' === has_tag() ) { ?>
<p class="spanlink"><span><?php esc_html_e( 'Keywords: ',
'scheduler' ); ?> </span> <?php the_tags( ' ', ', ' ); ?></p>
<?php } ?>
<?php if( has_category( ) ) { ?>
<p class="spanlink"><span><?php esc_html_e( 'Topic: ',
'scheduler' ); ?></span> <?php the_category( ' ', ', ' ); ?></p>
<?php } ?>
</footer>
<section id="comments">
<?php comments_template(); ?>
</section>
</div>
<?php } ?><?php
} // ends if/while loop
?>
</div>
</article>
</div>
</section>
<div class="clearfix"></div>
<?php get_footer(); ?>