-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcontent-attachment.php
66 lines (46 loc) · 1.67 KB
/
content-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 content for images (gallery) and other files.
*/
// No direct access
if ( ! defined( 'ABSPATH' ) ) exit;
?>
<article id="post-<?php the_ID(); ?>" <?php post_class( 'uplifted-entry-full uplifted-attachment-full' ); ?>>
<?php get_template_part( 'content-attachment-header' ); ?>
<div class="uplifted-entry-attachment">
<?php
// Image is displayed
if ( wp_attachment_is_image() ) :
?>
<div class="wp-caption aligncenter">
<?php echo wp_get_attachment_image( $post->ID, 'large' ); ?>
<?php if ( ctfw_has_manual_excerpt() ) : ?>
<p class="wp-caption-text">
<?php echo wptexturize( get_the_excerpt() ); ?>
</p>
<?php endif; ?>
</div>
<?php
// Other files are represented by download link
// (typically non-image file attachment pages are never linked to)
else :
?>
<a href="<?php echo esc_url( ctfw_force_download_url( wp_get_attachment_url( $post->ID ) ) ); ?>" class="uplifted-button uplifted-attachment-download">
<?php
$filetype = wp_check_filetype( wp_get_attachment_url( $post->ID ) );
if ( $filetype['ext'] ) {
/* translators: %s is file extension */
printf( __( 'Download %s', 'uplifted' ), strtoupper( $filetype['ext'] ) );
}
?>
</a>
<?php endif; ?>
</div> <!-- /uplifted-entry-attachment -->
<?php if ( ctfw_has_content() ) : ?>
<div class="uplifted-entry-content uplifted-clearfix">
<?php the_content(); ?>
<?php do_action( 'uplifted_after_content' ); ?>
</div>
<?php endif; ?>
<?php get_template_part( 'content-footer-full' ); // multipage nav, term lists, "Edit" button, etc. ?>
</article>