-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathattachment.php
executable file
·78 lines (50 loc) · 2.72 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
<?php
/**
* Attachment Template
*
* The attachment template is a general template that displays attachments if no other
* attachment-type template is found. Also see application.php, audio.php, image.php,
* text.php, and video.php.
*
* @package Hybrid
* @subpackage Template
* @link http://themehybrid.com/themes/hybrid/attachments
* @link http://codex.wordpress.org/Using_Image_and_File_Attachments
*/
get_header(); // Loads the header.php template. ?>
<div id="content" class="hfeed content">
<?php do_atomic( 'before_content' ); // hybrid_before_content ?>
<?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
<div id="post-<?php the_ID(); ?>" class="<?php hybrid_entry_class(); ?>">
<?php do_atomic( 'before_entry' ); // hybrid_before_entry ?>
<div class="entry-content">
<?php if ( wp_attachment_is_image( get_the_ID() ) ) : ?>
<p class="attachment-image">
<?php echo wp_get_attachment_image( get_the_ID(), 'full', false, array( 'class' => 'aligncenter' ) ); ?>
</p><!-- .attachment-image -->
<?php else : ?>
<?php hybrid_attachment(); // Function for handling non-image attachments. ?>
<p class="download">
<a href="<?php echo wp_get_attachment_url(); ?>" title="<?php the_title_attribute(); ?>" rel="enclosure" type="<?php echo get_post_mime_type(); ?>"><?php printf( __( 'Download "%1$s"', hybrid_get_textdomain() ), the_title( '<span class="fn">', '</span>', false) ); ?></a>
</p><!-- .download -->
<?php endif; ?>
<?php the_content( sprintf( __( 'Continue reading %1$s', hybrid_get_textdomain() ), the_title( ' "', '"', false ) ) ); ?>
<?php wp_link_pages( array( 'before' => '<p class="page-links pages">' . __( 'Pages:', hybrid_get_textdomain() ), 'after' => '</p>' ) ); ?>
</div><!-- .entry-content -->
<?php if ( wp_attachment_is_image( get_the_ID() ) ) : ?>
<p class="navigation-attachment">
<span class="alignleft"><?php previous_image_link(); ?></span>
<span class="alignright"><?php next_image_link(); ?></span>
</p><!-- .navigation-attachment -->
<?php endif; ?>
<?php do_atomic( 'after_entry' ); // hybrid_after_entry ?>
</div><!-- .hentry -->
<?php do_atomic( 'after_singular' ); // hybrid_after_singular ?>
<?php comments_template( '/comments.php', true ); // Loads the comments.php template ?>
<?php endwhile; ?>
<?php else: ?>
<?php get_template_part( 'loop-error' ); // Loads the loop-error.php template. ?>
<?php endif; ?>
<?php do_atomic( 'after_content' ); // hybrid_after_content ?>
</div><!-- .content .hfeed -->
<?php get_footer(); // Loads the footer.php template. ?>