-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathimage.php
67 lines (46 loc) · 1.65 KB
/
image.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
<?php
/**
* Attachment template.
*
* @package presscore
* @since presscore 0.1
*/
// File Security Check
if ( ! defined( 'ABSPATH' ) ) { exit; }
global $post;
$config = Presscore_Config::get_instance();
$config->set('template', 'image');
get_header(); ?>
<!-- Content -->
<div id="content" class="content" role="main">
<?php if ( have_posts() ) : ?>
<?php while ( have_posts() ) : the_post(); ?>
<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
<?php do_action('presscore_before_post_content'); ?>
<?php
$img_meta = wp_get_attachment_image_src( $post->ID, 'full' );
$img_args = array(
'img_meta' => $img_meta,
'img_id' => $post->ID,
'custom' => 'data-dt-img-description="' . esc_attr(get_the_excerpt()) . '"',
'class' => 'alignnone rollover rollover-zoom dt-single-mfp-popup dt-mfp-item mfp-image',
'title' => get_the_title(),
'wrap' =>'<a %HREF% %CLASS% %CUSTOM% %TITLE%><img %IMG_CLASS% %SRC% %ALT% %SIZE% /></a>'
);
if ( isset($img_meta[1]) && $img_meta[1] < 890 ) {
$img_args['wrap'] = "\n" . '<img %IMG_CLASS% %SRC% %SIZE% %ALT%/>' . "\n";
$img_args['class'] = '';
$img_args['img_class'] = 'alignleft';
$img_args['custom'] = '';
}
dt_get_thumb_img( $img_args );
the_content();
presscore_display_share_buttons_for_post( 'photo' );
?>
</article>
<?php do_action('presscore_after_post_content'); ?>
<?php endwhile; ?>
<?php endif; ?>
</div><!-- #content -->
<?php do_action('presscore_after_content'); ?>
<?php get_footer(); ?>