This repository was archived by the owner on Sep 7, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathsingular-vcard.php
More file actions
43 lines (43 loc) · 1.52 KB
/
singular-vcard.php
File metadata and controls
43 lines (43 loc) · 1.52 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
<?php function singular_vcard($position) {
if ( post_password_required() ) {
return;
}
if (get_theme_mod( 'display_vcard', 'end' ) == 'disabled') {
return;
}
if ($position == 'start' && get_theme_mod( 'display_vcard', 'end' ) != 'start') {
return;
}
if ($position == 'end' && get_theme_mod( 'display_vcard', 'end' ) != 'end') {
return;
}
?>
<!-- .article__vcard -->
<div class="article__vcard">
<div class="vcard__avatar">
<img src="<?php echo get_avatar_url(get_the_author_meta('user_email')); ?>">
<div class="vcard__name">
<?php if( get_the_author_meta( 'user_url' ) != '' ) { ?>
<a href="<?php the_author_meta( 'user_url' ); ?>"><?php the_author_meta( 'display_name' ); ?></a>
<?php } else { ?>
<?php the_author_meta( 'display_name' ); ?>
<?php } ?>
</div>
</div>
<div class="vcard__section">
<div class="vcard__name">
<?php if( get_the_author_meta( 'user_url' ) != '' ) { ?>
<a href="<?php the_author_meta( 'user_url' ); ?>"><?php the_author_meta( 'display_name' ); ?></a>
<?php } else { ?>
<?php the_author_meta( 'display_name' ); ?>
<?php } ?>
</div>
<?php if ( get_the_author_meta('description') != '' ) { ?>
<div class="vcard__bio">
<?php the_author_meta('description'); ?>
</div>
<?php } ?>
</div>
</div>
<!-- / .article__vcard -->
<?php } ?>