-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathauthor-card.php
80 lines (74 loc) · 3.35 KB
/
author-card.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
<?php
$profile_img_url = str_replace( '?s=96&', '?s=360&', $profile_img_url );
function bw_render_author_links( $helpers, $options ){ ?>
<ul class="btn-list mt-4 mb-2">
<?php if ( !is_author() ){ ?>
<li>
<a class="btn mb-2" title="Botwiki profile page" rel="me" href="<?php echo $options['botwiki_profile_page_url']; ?>">View profile</a>
</li>
<?php }
if ( !empty( $options['website_url'] ) ){ ?>
<li>
<a class="btn mb-2" title="Personal website" rel="me" href="<?php echo $options['website_url']; ?>"><?php echo $helpers->get_domain_from_url( $options['website_url'] ); ?>
</a>
</li>
<?php } ?>
<?php if ( !empty( $options['fediverse_handle'] )){ ?>
<li>
<a class="btn mb-2" title="Fediverse" rel="me" href="<?php echo $options['fediverse_url']; ?>"><?php echo $options['fediverse_handle']; ?></a>
</li>
<?php } ?>
<?php if ( !empty( $options['twitter_handle'] ) && $options['twitter_handle'] !== '@' ){ ?>
<li>
<a class="btn mb-2" title="Twitter" rel="me" href="https://twitter.com/<?php echo $options['twitter_handle']; ?>"><?php echo $options['twitter_handle']; ?></a>
</li>
<?php } ?>
</ul>
<?php }
$fediverse_url = $helpers->get_fediverse_url( $fediverse_handle );
$author_info = array(
'botwiki_profile_page_url' => $botwiki_profile_page_url,
'website_url' => $website_url,
'fediverse_handle' => $fediverse_handle,
'fediverse_url' => $fediverse_url,
'twitter_handle' => $twitter_handle,
);
?>
<div class="container card <?php
$post_type = get_post_type();
if ( is_author() ){
echo 'mt-n5';
} elseif ( $post_type === 'bot' ) {
echo 'mt-0';
} else {
echo 'mt-5';
}
?> mb-4 pl-0 pr-0 author-card">
<div class="card-body mt-4">
<div class="row">
<div class="col-sm-12 col-md-2 text-center text-md-left">
<a title="Botwiki profile page" rel="me" href="<?php echo $botwiki_profile_page_url; ?>">
<img loading="lazy" class="d-lg-none d-sm-block d-md-none lazy-load mt-3 mb-5 u-photo rounded-circle w-50" src="<?php echo $profile_img_url; ?>" data-src="<?php echo $profile_img_url; ?>" alt="<?php echo $full_name; ?>">
<img loading="lazy" class="d-none d-md-block d-lg-block lazy-load mb-4 u-photo rounded-circle" src="<?php echo $profile_img_url; ?>" data-src="<?php echo $profile_img_url; ?>" alt="<?php echo $full_name; ?>">
</a>
</div>
<div class="col-sm-12 col-md-10">
<a class="no-underline" title="Botwiki profile page" rel="me" href="<?php echo $botwiki_profile_page_url; ?>">
<h3 class="mt-0 mb-0 d-inline-block"><?php echo $nickname; ?></h3>
</a>
<?php if ( !is_author() ){ ?>
<p class="mt-3"><strong><?php echo $botwiki_team_role; ?></strong></p>
<?php } ?>
<?php if ( !is_author() ){ bw_render_author_links( $helpers, $author_info ); } ?>
<?php if ( is_author() ){
if ( !empty( $description ) ){ ?>
<p><?php echo $description; ?></p>
<?php } else { ?>
<p><?php echo $botwiki_team_role; ?></p>
<?php }
bw_render_author_links( $helpers, $author_info );
} ?>
</div>
</div>
</div>
</div>