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 26
/
author.php
171 lines (161 loc) · 8.93 KB
/
author.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
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
<?php get_header(); ?>
<!-- row -->
<div class="row">
<div class="box box-widget">
<div class="box-body box-profile">
<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>
<div class="info text-center">
<ul class="list-unstyled list-inline">
<?php if (get_the_author_meta('dt_facebook') != '') : ?>
<li><a href="<?php echo get_the_author_meta('dt_facebook'); ?>" target="_blank">
<i class="fa fa-facebook fa-2x"></i></a></li>
<?php endif; ?>
<?php if (get_the_author_meta('dt_twitter') != '') : ?>
<li><a href="<?php echo get_the_author_meta('dt_twitter'); ?>" target="_blank">
<i class="fa fa-twitter fa-2x"></i></a></li>
<?php endif; ?>
<?php if (get_the_author_meta('dt_googleplus') != '') : ?>
<li><a href="<?php echo get_the_author_meta('dt_google-plus'); ?>" target="_blank">
<i class="fa fa-google-plus fa-2x"></i></a></li>
<?php endif; ?>
<?php if (get_the_author_meta('dt_pinterest') != '') : ?>
<li><a href="<?php echo get_the_author_meta('dt_pinterest'); ?>" target="_blank">
<i class="fa fa-pinterest fa-2x"></i></a></li>
<?php endif; ?>
<?php if (get_the_author_meta('dt_linkedin') != '') : ?>
<li><a href="<?php echo get_the_author_meta('dt_linkedin'); ?>" target="_blank">
<i class="fa fa-linkedin fa-2x"></i></a></li>
<?php endif; ?>
</ul>
</div>
</div>
<!-- /.box-body -->
<?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; ?>
<div class="col-md-12">
<div class="row" id="posts">
<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
<div class="col-xs-12 col-sm-6 col-md-6 col-lg-6">
<div class="box box-widget">
<div class="box-header with-border">
<div class="user-block">
<span class="username">
<a href="<?php the_permalink() ?>" title="<?php the_title(); ?>"
title="<?php the_title(); ?> "><?php the_title(); ?></a></span>
<ul class="description list-inline">
<li><i class="fa fa-calendar"></i> <?php the_time('d.m.Y ') ?> |
</li>
<li><i class="fa fa-user"></i> <a
href="<?php echo esc_url(get_author_posts_url(get_the_author_meta('ID'))); ?>"
title="<?php the_author(); ?>"><?php the_author(); ?></a> |
</li>
<li><i class="fa fa-folder-open"></i> <?php the_category(', ') ?> |
</li>
<li>
<i class="fa fa-comments"></i> <?php comments_number('0 comment', '1 comment', '% comments'); ?>
</li>
</ul>
</div>
<!-- /.user-block -->
</div>
<!-- /.box-header -->
<div class="box-body">
<div class="caption">
<a href="<?php the_permalink() ?>" title="<?php the_title(); ?>">
<?php $img = wp_get_attachment_image_src(get_post_thumbnail_id(), 'medium');
if (has_post_thumbnail()) : ?>
<img src="<?php echo $img[0]; ?>" class="img-responsive pad"
alt="<?php the_title(); ?>" title="<?php the_title() ?>"/>
<?php endif ?>
</a>
</div>
<a href="<?php the_permalink() ?>"
title="<?php the_title(); ?>"><?php the_excerpt_rss(); ?></a>
</div>
<!-- /.box-body -->
</div>
<!-- /.box -->
</div>
<?php endwhile; ?>
<?php else : ?>
</div>
<div class="error-page">
<h3><i class="fa fa-warning text-yellow"></i> Oops! Articles not found.</h3>
<p>
There is no article.
Meanwhile, you may <a href="<?php bloginfo('url'); ?>">return to home</a> or try using
the
search form.
</p>
<form action="<?php bloginfo('url'); ?>" class="search-form">
<div class="input-group">
<input type="text" name="s" class="form-control" placeholder="Search">
<div class="input-group-btn">
<button type="submit" class="btn btn-warning btn-flat"><i
class="fa fa-search"></i>
</button>
</div>
</div>
<!-- /.input-group -->
</form>
</div>
<!-- /.error-page -->
<?php endif; ?>
</div>
<div id="inifiniteLoader"><i class="fa fa-2x fa-refresh fa-spin"></i></div>
</div>
<?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 -->
<script type="text/javascript">
jQuery(document).ready(function ($) {
var count = 2;
var total = <?php echo $wp_query->max_num_pages; ?>;
$(window).scroll(function () {
if ($(window).scrollTop() == $(document).height() - $(window).height()) {
if (count > total) {
return false;
} else {
loadArticle(count);
}
count++;
}
});
function loadArticle(pageNumber) {
$('#inifiniteLoader').show();
$.ajax({
url: "<?php echo admin_url(); ?>admin-ajax.php",
type: 'POST',
data: "action=infinite_scroll&page_no=" + pageNumber + '&loop_file=loop&what=author_name&value=<?php echo $curauth->user_nicename; ?>',
success: function (html) {
$('#inifiniteLoader').hide('1000');
$("#posts").append(html);
}
});
return false;
}
});
</script>
<?php get_footer(); ?>