1
|
|
|
<?php |
2
|
|
|
/** |
3
|
|
|
* The template for displaying the author pages. |
4
|
|
|
* |
5
|
|
|
* Learn more: https://codex.wordpress.org/Author_Templates |
6
|
|
|
* |
7
|
|
|
* @package spurs |
8
|
|
|
*/ |
9
|
|
|
|
10
|
|
|
// Exit if accessed directly. |
11
|
|
|
defined( 'ABSPATH' ) || exit; ?> |
12
|
|
|
|
13
|
|
|
<header class="page-header author-header"> |
14
|
|
|
|
15
|
|
|
<?php |
16
|
|
|
if ( isset( $_GET['author_name'] ) ) { |
17
|
|
|
$curauth = get_user_by( 'slug', $author_name ); |
18
|
|
|
} else { |
19
|
|
|
$curauth = get_userdata( intval( $author ) ); |
20
|
|
|
} |
21
|
|
|
?> |
22
|
|
|
|
23
|
|
|
<h1><?php esc_html_e( 'About:', 'spurs' ); ?><?php echo esc_html( $curauth->nickname ); ?></h1> |
24
|
|
|
|
25
|
|
|
<?php if ( ! empty( $curauth->ID ) ) : |
26
|
|
|
echo get_avatar( $curauth->ID ); |
27
|
|
|
endif; ?> |
28
|
|
|
<?php if ( ! empty( $curauth->user_url ) || ! empty( $curauth->user_description ) ) : ?> |
29
|
|
|
<dl> |
30
|
|
|
<?php if ( ! empty( $curauth->user_url ) ) : ?> |
31
|
|
|
<dt><?php esc_html_e( 'Website', 'spurs' ); ?></dt> |
32
|
|
|
<dd> |
33
|
|
|
<a href="<?php echo esc_url( $curauth->user_url ); ?>"><?php echo esc_html( $curauth->user_url ); ?></a> |
34
|
|
|
</dd> |
35
|
|
|
<?php endif; ?> |
36
|
|
|
|
37
|
|
|
<?php if ( ! empty( $curauth->user_description ) ) : ?> |
38
|
|
|
<dt><?php esc_html_e( 'Profile', 'spurs' ); ?></dt> |
39
|
|
|
<dd><?php echo esc_html_e( $curauth->user_description ); ?></dd> |
40
|
|
|
<?php endif; ?> |
41
|
|
|
</dl> |
42
|
|
|
<?php endif; ?> |
43
|
|
|
<h2><?php esc_html_e( 'Posts by', 'spurs' ); ?> <?php echo esc_html( $curauth->nickname ); ?>:</h2> |
44
|
|
|
|
45
|
|
|
</header><!-- .page-header --> |
46
|
|
|
|
47
|
|
|
<div class="page-content"> |
48
|
|
|
<ul> |
49
|
|
|
<!-- The Loop --> |
50
|
|
|
<?php if ( have_posts() ) : |
51
|
|
|
while ( have_posts() ) : the_post(); ?> |
|
|
|
|
52
|
|
|
<li> |
53
|
|
|
<?php |
54
|
|
|
printf( |
55
|
|
|
'<a rel="bookmark" href="%1$s" title="%2$s %3$s">%3$s</a>', |
56
|
|
|
esc_url( apply_filters( 'the_permalink', get_permalink( $post ), $post ) ), |
57
|
|
|
esc_attr( __( 'Permanent Link:', 'spurs' ) ), |
58
|
|
|
the_title( '', '', false ) |
59
|
|
|
); |
60
|
|
|
spurs_posted_on(); |
61
|
|
|
esc_html_e( 'in', 'spurs' ); |
62
|
|
|
the_category( '&' ); |
63
|
|
|
?> |
64
|
|
|
</li> |
65
|
|
|
<?php endwhile; |
66
|
|
|
else : |
67
|
|
|
get_template_part( 'templates/loop/content', 'none' ); |
68
|
|
|
endif; ?> |
69
|
|
|
<!-- End Loop --> |
70
|
|
|
</ul> |
71
|
|
|
</div> |
72
|
|
|
|
73
|
|
|
|