-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsingle.php
More file actions
164 lines (124 loc) · 4.29 KB
/
single.php
File metadata and controls
164 lines (124 loc) · 4.29 KB
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
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
<?php
/**
* @package WordPress
* @subpackage Gentle
*/
get_header(); ?>
<?php
global $post_type;
global $post;
$sidebar_position = '';
$mp_option = gentle_get_global_options();
$post_type = $post->post_type;
$sidebar_position = $mp_option['gentle_single_sidebar'];
if($post_type == 'portfolio'){
$sidebar_position = $sidebar_position['radio_sb_portfolio'];
} else {
$sidebar_position = $sidebar_position['radio_sb_blog'];
}
if($sidebar_position == '')
$sidebar_position = 'right';
?>
<div id="mpc-content" role="main">
<div id="mpc-page-wrap" class="sidebar-<?php echo $sidebar_position; ?>">
<div id="mpc-page-content" class="gentle-single-page gentle-single-<?php echo $post_type; ?> sidebar-<?php echo $sidebar_position; ?>">
<?php if ( have_posts() ) { ?>
<?php while ( have_posts() ) {
the_post();
$post_meta = '';
$post_meta = get_post_custom($post->ID);
/* Get post data */
if(isset($post_meta['post_shortcode'][0]))
$page_data['sh'] = $post_meta['post_shortcode'][0];
/* lightbox parameters */
if(isset($post_meta['lightbox_enable'][0]))
$page_data['lb'] = $post_meta['lightbox_enable'][0];
if(isset($post_meta['caption'][0]))
$page_data['lb_caption'] = $post_meta['caption'][0];
if(isset($post_meta['lightbox_src'][0]))
$page_data['lb_src'] = $post_meta['lightbox_src'][0];
?>
<article id="post-<?php the_ID(); ?>" class="post">
<div class="mpc-post-thumbnail">
<?php if(isset($page_data['sh']) && $page_data['sh'] != '') {
$sh = $page_data['sh'];
$search = substr($sh, 0, 1);
if($search == '[')
echo do_shortcode($sh);
else
echo $sh;
} ?>
</div><!-- end post-thumbnail -->
<h3 class="mpc-page-title"><?php the_title(); ?></h3>
<small>
<?php the_time('M d Y');?>
<?php if($post_type == 'post') {
echo '· ';
comments_number('0 comments','1 comment','% comments');
}?>
<?php if($post_type == 'post') {
echo '· ';
the_category(', ');
} else {
echo '·';
$categories = get_the_terms(get_the_ID(), 'portfolio_cat');
$length = count($categories);
$i = 0;
$return = ' ';
foreach($categories as $category) {
$return .= ' <a href="'.get_term_link($category->slug, 'portfolio_cat').'">';
$return .= $category->name;
$return .= '</a>';
if($i != $length - 1)
$return .=', ';
$i++;
}
echo $return.' ';
}?>
<?php if( function_exists('zilla_likes') ) {
echo '·';
zilla_likes();
}?>
</small>
<p class="mpc-post-content">
<?php the_content(); ?>
</p>
<?php if(function_exists('zilla_share')) { ?>
<div class="mpc-genlte-post-share-wrap">
<span class="mpc-genlte-post-share"><span class="gentle-icon-share"></span></span>
<?php zilla_share(); ?>
</div>
<?php } ?>
</article><!-- post -->
<!-- If show related posts -->
<div id="gentle_tags">
<?php
_e('Tags: ', 'gentle');
the_tags('', ', ', '.'); ?>
</div>
<div class="gentle-related-posts">
<?php if($post_type == 'portfolio' && $mp_option[$shortname.'_related_portfolio'] == "1") { ?>
<h3><? //php _e('Related Projects', 'gentle');?></h3>
<?php
$postID = $post->ID;
echo do_shortcode('[mpc_recent_portfolio number="6" post="'.$postID.'"]'); ?>
<?php } else if($post_type != 'portfolio' && $mp_option[$shortname.'_related_posts'] == "1") { ?>
<h3><?php _e('Related Posts', 'gentle'); ?></h3>
<?php
$postID = $post->ID;
echo do_shortcode('[mpc_recent_posts number="6" post="'.$postID.'"]'); ?>
<?php } ?>
</div>
<?php if($post_type == "post") {?>
<div class="post-comments">
<?php comments_template('', true); ?>
</div><!-- post_comments -->
<?php } ?>
<?php } ?>
<?php } ?>
</div> <!-- end mpc-page-content-->
<?php if($sidebar_position != "none")
get_sidebar(); ?>
</div> <!-- end mpc-page-wrap -->
</div><!-- end mpc-content -->
<?php get_footer(); ?>