/
author.php
178 lines (135 loc) · 4.2 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
172
173
174
175
176
177
178
<?php
/**
* Archive Template
*
* @package Shades
* @since 1.0
*
* @link http://buynowshop.com/themes/shades/
* @link https://github.com/Cais/shades/
* @link https://wordpress.org/themes/shades/
*
* @author Edward Caissie <edward.caissie@gmail.com>
* @copyright Copyright (c) 2009-2015, Edward Caissie
*
* @version 2.1
* @date March 8, 2013
* Refactored code formatting and code block termination comments
* Refactored post meta to be more i18n compatible
*
* @version 2.1.1
* @date July 18, 2013
* Changed Featured Image code to use `shades_show_featured_image( 'full' )`
*
* @version 2.1.2
* @date December 28, 2013
* i18n update for `Permalink to: ` phrase
*
* @version 2.4
* @date May 30, 2015
* Improved i18n implementations
*/
get_header();
/** This sets the $curauth variable */
$curauth = ( get_query_var( 'author_name ' ) ) ? get_user_by( 'id', get_query_var( 'author_name' ) ) : get_userdata( get_query_var( 'author' ) ); ?>
<div id="maintop"></div><!--end maintop-->
<div id="wrapper">
<div id="content">
<div id="the-loop">
<div id="author" class="<?php
/** Add class as related to the user role (see 'Role:' drop-down in User options) */
if ( user_can( $curauth->ID, 'administrator' ) ) {
echo 'administrator';
} elseif ( user_can( $curauth->ID, 'editor' ) ) {
echo 'editor';
} elseif ( user_can( $curauth->ID, 'contributor' ) ) {
echo 'contributor';
} elseif ( user_can( $curauth->ID, 'subscriber' ) ) {
echo 'subscriber';
} else {
echo 'guest';
}
if ( ( $curauth->ID ) == '1' ) {
echo ' administrator-prime';
} ?>">
<h2>
<?php _e( 'About ', 'shades' ); ?><?php echo $curauth->display_name; ?>
</h2>
<ul>
<?php if ( ! empty( $curauth->user_url ) ) { ?>
<li>
<?php printf( '%1$s: %2$s or %3$s',
__( 'Website', 'shades' ),
'<a href="' . $curauth->user_url . '">' . $curauth->user_url . '</a>',
'<a href="mailto:' . $curauth->user_email . '">' . __( 'email', 'shades' ) . '</a>' ); ?>
</li>
<?php }
if ( ! empty( $curauth->user_description ) ) { ?>
<li>
<?php printf( '%1$s: %2$s',
__( 'Biography', 'shades' ),
$curauth->user_description ) ?>
</li>
<?php } ?>
</ul>
</div>
<!-- #author -->
<h2>
<?php printf( __( 'Posts by %1$s', 'shades' ), $curauth->display_name ); ?>
</h2>
<!-- start the_Loop -->
<?php if ( have_posts() ) {
$count = 0;
while ( have_posts() ) {
the_post();
$count ++;
if ( $count == 1 ) {
get_template_part( 'content', get_post_format() );
} else { ?>
<div <?php post_class(); ?>
id="post-<?php the_ID(); ?>">
<h1>
<a href="<?php the_permalink(); ?>"
title="<?php the_title_attribute(
array(
'before' => __( 'Permalink to:', 'shades' ) . ' ',
'after' => ''
)
); ?>"><?php the_title(); ?></a>
</h1>
<div class="postdata">
<?php
printf(
__( '%1$s on %2$s in %3$s', 'shades' ),
shades_use_posted(),
get_the_time( get_option( 'date_format' ) ),
get_the_category_list( ', ' )
);
the_shortlink( __( 'Short Link', 'shades' ), '', ' | ', '' ); ?>
<br />
<?php
comments_popup_link();
edit_post_link( __( 'Edit', 'shades' ), ' | ', '' ); ?>
</div>
<!-- .postdata -->
<?php
shades_show_featured_image( 'full' );
the_excerpt(); ?>
<div class="clear"></div>
<!-- For inserted media at the end of the post -->
<p class="tags"><?php the_tags(); ?></p>
</div><!-- .post #post-ID -->
<?php }
}
get_template_part( 'shades-navigation' );
} else {
get_template_part( 'shades-no-posts' );
} ?>
</div>
<!-- #the-loop -->
<?php get_sidebar(); ?>
<div class="clear"></div>
</div>
<!--end content-->
</div><!--end wrapper-->
<?php get_footer();