-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathauthor.php
More file actions
106 lines (88 loc) · 3.33 KB
/
author.php
File metadata and controls
106 lines (88 loc) · 3.33 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
<?php
/*
Template Name: Archives
*/
?>
<?php function get_trim_text ($string) {
$maxlen = 180;
$excerpt = $string;
$excerptlen = strlen($excerpt);
if ($excerptlen > $maxlen) {
$excerpt = substr($excerpt, 0, $maxlen).'...';
$excerptlen = $maxlen + 3;
}
if ($excerpt[0] == '"')
$excerpt = substr($excerpt, 0, $excerptlen-1);
return $excerpt;
}?>
<div id="container">
<div id="content" role="main">
<?php
$curauth = (isset($_GET['author_name'])) ? get_user_by('slug', $author_name) : get_userdata(intval($author));
?>
<div class="page-header myfull">
<h2 style="color:#000"> . </h2>
</div>
<p class="spaceup"></p>
<div class="row">
<div class="med-left expert">
<?php echo get_avatar( $curauth->get('ID'), $size = '256', $default = '<path_to_url>' ); ?>
</div>
<div class="med-body">
<h2 class="noborder"> <a style="text-decoration: none;"><?php echo esc_html( $curauth->first_name ); ?> <?php echo esc_html( $curauth->last_name ); ?> </a> </h2>
<p><b><?php echo esc_html( $curauth->title ); ?></b></p>
<p><?php the_author_description(); ?></p>
<p><small><a href="https://sciencefeedback.co/team-advisors-contributors/">The Science Feedback team</a></small></p>
</div>
</div>
<!-- ARTICLE REVIEWS Listing -->
<?php
$args = array( 'post_type' => 'evaluation' , 'author' => $curauth->ID ) ;
$loop = new WP_Query( $args );
?>
<?php if ($loop->have_posts()) :?>
<?php
echo '<p class="spaceup"></p><div class="row"><section class="separator"><h3 class="inseparator"> ARTICLE REVIEWS </h3> </section></div>';
while ($loop->have_posts() ) : $loop->the_post();
get_template_part('templates/loop-feedbacks-noex', get_post_type());
endwhile;
?>
<?php endif; ?>
<?php wp_reset_query(); ?>
<!-- CLAIM REVIEWS Listing -->
<?php
$args = array( 'post_type' => 'claimreview' , 'author' => $curauth->ID ) ;
$loop = new WP_Query( $args );
?>
<?php if ($loop->have_posts()) :?>
<?php
echo '<p class="spaceup"></p><div class="row"><section class="separator"><h3 class="inseparator"> CLAIM REVIEWS </h3> </section></div>';
while ($loop->have_posts() ) : $loop->the_post();
get_template_part('templates/loop-claimreviews');
endwhile;
?>
<?php endif; ?>
<?php wp_reset_query(); ?>
<!-- INSIGHTS Listing -->
<?php
$theCatId = get_term_by( 'slug', 'insight', 'category' );
$theCatId = $theCatId->term_id;
$args = array(
'post_type' => array('post'),
'cat' => $theCatId,
'author' => $curauth->ID,
'posts_per_page' => 10
);
$loop = new WP_Query( $args );
?>
<?php if ($loop->have_posts()) :?>
<?php
echo '<p class="spaceup"></p><div class="row"><section class="separator"><h3 class="inseparator"> INSIGHTS </h3> </section></div>';
while ($loop->have_posts() ) : $loop->the_post();
get_template_part('templates/loop-insights');
endwhile;
?>
<?php endif; ?>
<?php the_posts_navigation(); ?>
</div><!-- #content -->
</div><!-- #container -->