-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathcontent-single.php
117 lines (82 loc) · 2.69 KB
/
content-single.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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
<?php
/**
* @package presscore
* @since presscore 0.1
*/
// File Security Check
if ( ! defined( 'ABSPATH' ) ) { exit; }
global $post;
// thumbnail visibility
$hide_thumbnail = (bool) get_post_meta($post->ID, '_dt_post_options_hide_thumbnail', true);
?>
<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
<?php do_action('presscore_before_post_content'); ?>
<?php if ( !post_password_required() ) : ?>
<?php
$img_class = 'alignleft';
$img_options = array( 'w' => 270, 'z' => 1 );
$post_format = get_post_format();
switch ( $post_format ) {
case 'video':
// thumbnail
if ( has_post_thumbnail() && ( $video_url = esc_url( get_post_meta( get_post_thumbnail_id(), 'dt-video-url', true ) ) ) ) {
echo '<div class="post-video alignnone">' . dt_get_embed( $video_url ) . '</div>';
}
// post content
the_content();
break;
case 'gallery':
// post content
the_content();
break;
case 'aside':
case 'link':
case 'quote':
case 'status':
// post content
presscore_get_template_part( 'theme', 'blog/blog-post-content-part', $post_format );
break;
case 'image':
default:
$img_class = 'alignnone';
$img_options = false;
// thumbnail
if ( has_post_thumbnail() && !$hide_thumbnail ) {
$thumb_id = get_post_thumbnail_id();
$thumb_meta = wp_get_attachment_image_src( $thumb_id, 'full' );
dt_get_thumb_img( array(
'class' => $img_class . ' rollover rollover-zoom dt-single-mfp-popup dt-mfp-item mfp-image',
'img_meta' => $thumb_meta,
'img_id' => $thumb_id,
'options' => $img_options,
'wrap' => '<a %HREF% %CLASS% %CUSTOM% title="%RAW_ALT%" data-dt-img-description="%RAW_TITLE%"><img %IMG_CLASS% %SRC% %SIZE% %IMG_TITLE% %ALT% /></a>',
) );
}
// post content
the_content();
}
?>
<?php wp_link_pages( array( 'before' => '<div class="page-links">' . __( 'Pages:', 'the7mk2' ), 'after' => '</div>' ) ); ?>
<?php
$post_tags = '';
$config = presscore_get_config();
if ( $config->get( 'post.meta.fields.tags' ) ) {
$post_tags = presscore_get_post_tags_html();
}
$share_buttons = presscore_display_share_buttons_for_post('post', array('echo' => false));
if ( $share_buttons || $post_tags ) {
printf( '<div class="post-meta wf-mobile-collapsed">%s</div>', $post_tags . $share_buttons );
}
?>
<?php
// 'theme options' -> 'general' -> 'show author info on blog post pages'
if ( $config->get( 'post.author_block' ) ) {
presscore_display_post_author();
}
?>
<?php presscore_display_related_posts(); ?>
<?php else: ?>
<?php the_content(); ?>
<?php endif; // !post_password_required ?>
<?php do_action('presscore_after_post_content'); ?>
</article><!-- #post-<?php the_ID(); ?> -->