-
Notifications
You must be signed in to change notification settings - Fork 0
/
single.php
145 lines (136 loc) · 6.78 KB
/
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
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
<?php
/**
* @author Tentaz
* @since 1.0
* @version 1.0
*/
get_header();
$solida_option = get_option( 'solida_option' );
$post_id = get_the_id();
$author_id = get_post_field ('post_author', $post_id);
$display_name = get_the_author_meta( 'display_name' , $author_id );
?>
<div class="container">
<div id="content">
<?php
//checking page layout
$page_layout = get_post_meta( $post->ID, 'layout', true );
$col_side = '';
$col_letf = '';
if($page_layout == '2left'){
$col_side = '8';
$col_letf = 'left-sidebar';}
else if($page_layout == '2right'){
$col_side = '8';}
else{
$col_side = '12';
}
?>
<!-- Blog Detail Start -->
<div class="tentaz-blog-details pt-70 pb-70">
<div class="row padding-<?php echo esc_attr( $col_letf) ?>">
<div class="col-lg-<?php echo esc_attr( $col_side). ' ' .esc_attr( $col_letf) ?>">
<?php
while ( have_posts() ) : the_post();
?>
<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
<?php if(has_post_thumbnail()){ ?>
<div class="bs-img">
<?php the_post_thumbnail(); ?>
</div>
<?php } ?>
<?php if(!empty($solida_option['blog-meta-single']) ){ ?>
<?php } else { ?>
<ul class="single-posts-meta">
<li>
<span class="p-date">
<i class="ri-calendar-line"></i> <?php $post_date = get_the_date(); echo esc_attr($post_date);?>
</span>
</li>
<li>
<span class="p-user">
<i class="ri-user-3-line"></i> <?php echo esc_html($display_name); ?>
</span>
</li>
<li class="post-cate">
<?php
//tag add
$seperator = ', '; // blank instead of comma
$after = '';
$before = '';
echo '<div class="tag-line">';
?>
<i class="ri-file-copy-line"></i>
<?php
the_category(', ');
echo '</div>';
?>
</li>
<li class="post-comment">
<i class="ri-chat-4-line"></i> <?php echo get_comments_number( '0', '1', '%' ); ?>
</li>
</ul>
<?php } ?>
<?php
get_template_part( 'template-parts/post/content', get_post_format() );
?>
<div class="clear-fix"></div>
</article>
<?php
$author_meta = get_the_author_meta('description');
if( !empty($author_meta) ){
?>
<div class="author-block">
<div class="author-img"> <?php echo get_avatar(get_the_author_meta( 'ID' ), 200);?> </div>
<div class="author-desc">
<h3 class="author-title">
<?php the_author();?>
</h3>
<p>
<?php
echo wpautop( get_the_author_meta( 'description' ) );
?>
</p>
<a href="<?php echo esc_url(get_the_author_meta('user_url'))?>" target="_blank">
<?php echo esc_url(get_the_author_meta( 'user_url'))?></a>
</div>
</div>
<!-- .author-block -->
<?php }
?>
<?php if(!empty($solida_option['blog-pagination']) ){ ?>
<?php } else { ?>
<?php get_template_part( 'pagination' ); ?>
<?php } ?>
<?php
$blog_author = '';
if($blog_author == ""){
if ( comments_open() || get_comments_number() ) :
comments_template();
endif;
}
else
{
$blog_author = $solida_option['blog-comments'];
if($blog_author == 'show'){
// If comments are open or we have at least one comment, load up the comment template.
if ( comments_open() || get_comments_number() ) :
comments_template();
endif;
}
}
endwhile; // End of the loop.
?>
</div>
<?php
if( $page_layout == '2left' || $page_layout == '2right'):
get_sidebar('single');
endif; ?>
</div>
</div>
<!-- Blog Detail End -->
</div>
</div>
<!-- .container -->
<?php
get_footer();