This repository has been archived by the owner on Nov 12, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 27
/
single.php
155 lines (149 loc) · 8.79 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
146
147
148
149
150
151
152
153
154
155
<?php get_header(); ?>
<div class="row" id="post">
<?php if (get_option('ad_header') != '') : ?>
<div class="col-md-12 hidden-xs hidden-sm ad">
<?php echo stripslashes(get_option('ad_header')); ?>
</div>
<?php endif; ?>
<?php if (get_option('ad_header_mobile') != '') : ?>
<div class="col-md-12 visible-xs visible-sm ad">
<?php echo stripslashes(get_option('ad_header_mobile')); ?>
</div>
<?php endif; ?>
<!-- /.col -->
<div class="col-md-<?php echo get_option('sidebar_check') == 'true' ? 9 : 12 ?>">
<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
<?php $img = wp_get_attachment_image_src(get_post_thumbnail_id(), 'large'); ?>
<div class="box box-widget">
<div class="box-header with-border">
<div class="user-block">
<h2><?php the_title(); ?></h2>
<ul class="description list-inline list-unstyled">
<li><i class="fa fa-calendar"></i> <?php the_time('d.m.Y') ?></li>
<li>
<i class="fa fa-user margin-r-5"></i>
<a href="<?php echo esc_url(get_author_posts_url(get_the_author_meta('ID'))); ?>"
class="text-sm">
<?php the_author(); ?>
</a>
</li>
<li><i class="fa fa-folder-open margin-r-5"></i> <?php the_category(', ') ?>
</li>
<li class="pull-right">
<i class="fa fa-comments-o margin-r-5"></i>
Comments (<?php comments_number('0', '1', '%'); ?>)
</li>
</ul>
<ul class="list-inline">
<li><i class="fa fa-share"></i> Share</li>
<li>
<a target="_blank" title="<?php the_title(); ?>" class="fa fa-facebook-square fa-2x"
href="http://www.facebook.com/share.php?u=<?php the_permalink() ?>">
</a>
</li>
<li>
<a target="_blank" title="<?php the_title(); ?>" class="fa fa-twitter-square fa-2x"
href="http://twitter.com/intent/tweet?status=<?php the_title(); ?>+<?php the_permalink() ?>">
</a>
</li>
<li>
<a target="_blank" title="<?php the_title(); ?>" class="fa fa-linkedin-square fa-2x"
href="http://www.linkedin.com/shareArticle?mini=true&url=<?php the_permalink() ?>">
</a>
</li>
<li>
<a target="_blank" title="<?php the_title(); ?>" class="fa fa-google-plus-square fa-2x"
href="https://plus.google.com/share?url=<?php the_permalink() ?>"></a>
</li>
</ul>
</div>
</div>
<!-- /.box-header -->
<div class="box-body">
<div class="box box-widget">
<div class="box-body box-profile" style="background-image: url('<?php echo has_post_thumbnail() ? $img[0] : bloginfo('template_url') . '/assets/img/default.jpg' ?>')">
<a class="author-link"
href="<?php echo esc_url(get_author_posts_url(get_the_author_meta('ID'))); ?>"
rel="author">
<img class="profile-user-img img-responsive img-circle" src="<?php
$author_bio_avatar_size = apply_filters('twentyfifteen_author_bio_avatar_size', 56);
echo get_avatar_url(get_the_author_meta('user_email'), $author_bio_avatar_size);
?>" alt="User profile picture">
<h3 class="profile-username text-center"><?php echo get_the_author(); ?></h3>
<p class="text-muted text-center"><?php the_author_meta('description'); ?></p>
</a>
</div>
<!-- /.box-body -->
</div>
<!-- /.box -->
<div class="post-content">
<?php the_content(); ?>
</div>
<!-- Social sharing buttons -->
<ul class="list-inline">
<li><i class="fa fa-share"></i> Share</li>
<li>
<a target="_blank" title="<?php the_title(); ?>" class="fa fa-facebook-square fa-2x"
href="http://www.facebook.com/share.php?u=<?php the_permalink() ?>">
</a>
</li>
<li>
<a target="_blank" title="<?php the_title(); ?>" class="fa fa-twitter-square fa-2x"
href="http://twitter.com/intent/tweet?status=<?php the_title(); ?>+<?php the_permalink() ?>">
</a>
</li>
<li>
<a target="_blank" title="<?php the_title(); ?>" class="fa fa-linkedin-square fa-2x"
href="http://www.linkedin.com/shareArticle?mini=true&url=<?php the_permalink() ?>">
</a>
</li>
<li>
<a target="_blank" title="<?php the_title(); ?>" class="fa fa-google-plus-square fa-2x"
href="https://plus.google.com/share?url=<?php the_permalink() ?>"></a>
</li>
</ul>
<?php
// If comments are open or we have at least one comment, load up the comment template
if (comments_open() || '0' != get_comments_number()) :
comments_template();
endif;
?>
</div>
<div class="box box-widget">
<div class="box-body">
<div class="row related-articles clearfix">
<?php $posts = get_posts('orderby=rand&numberposts=8');
foreach ($posts as $post) : ?>
<?php $image = wp_get_attachment_image_src(get_post_thumbnail_id(), 'medium'); ?>
<div class="col-xs-6 col-sm-4 col-md-3">
<a href="<?php the_permalink() ?>" title="<?php the_title(); ?>" class="caption" style="background-image: url('<?php echo $image[0]; ?>')">
<div class="overlay"></div>
<span><?php the_title(); ?></span>
</a>
</div>
<?php endforeach; ?>
</div>
</div><!-- /.box-body -->
</div><!--/.box -->
</div>
<?php endwhile; ?>
<?php endif; ?>
</div>
<?php if (get_option('sidebar_check') == 'true') : ?>
<div class="col-md-3 side-bar hidden-xs hidden-sm">
<?php dynamic_sidebar('Side Bar'); ?>
</div>
<?php endif ?>
<?php if (get_option('ad_footer') != '') : ?>
<div class="col-md-12 hidden-xs hidden-sm ad">
<?php echo stripslashes(get_option('ad_footer')); ?>
</div>
<?php endif; ?>
<?php if (get_option('ad_footer_mobile') != '') : ?>
<div class="col-md-12 visible-xs visible-sm ad">
<?php echo stripslashes(get_option('ad_footer_mobile')); ?>
</div>
<?php endif; ?>
</div>
<!-- /.row -->
<?php get_footer(); ?>