/
author.php
89 lines (88 loc) · 5.53 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
<?php
/**
* @package Multi
*
* @version 1.9.1
* Last revised December 1, 2011
*
* @todo Remove? This template file may be identical to the Desk Mess Mirrored version
*/
get_header();
/** Set 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>
<div id="wrapper">
<div id="content">
<div id="main-blog">
<div id="author" class="<?php
/** @var $author string */ if ( ( get_userdata( intval( $author ) )->ID ) == '1' ) echo 'administrator';
/** elseif ( ( get_userdata( intval( $author ) )->ID ) == '2' ) echo 'jellybeen'; */ /* sample */
/** add additional user_id following above example, echo the 'CSS element' you want to use for styling
* @todo re-write this ... preferably remove the whole thing, but for backward compatibility it probably needs to be re-written
*/ ?>">
<h2><?php _e( 'About ', 'desk-mess-mirrored' ); echo $curauth->display_name; ?></h2>
<ul>
<li><?php _e( 'Website', 'desk-mess-mirrored' ); ?>: <a href="<?php echo $curauth->user_url; ?>"><?php echo $curauth->user_url; ?></a> <?php _e( 'or', 'desk-mess-mirrored' ); ?> <a href="mailto:<?php echo $curauth->user_email; ?>"><?php _e( 'email', 'desk-mess-mirrored' ); ?></a></li>
<li><?php _e( 'Biography', 'desk-mess-mirrored' ); ?>: <?php echo $curauth->user_description; ?></li>
</ul>
</div> <!-- #author -->
<h2><?php _e( 'Posts by ', 'desk-mess-mirrored' ); echo $curauth->display_name; ?>:</h2>
<!-- start the Loop -->
<?php if ( have_posts() ) :
$count = 0;
while ( have_posts() ) : the_post();
$count++; ?>
<div class="clear"> </div>
<div <?php post_class(); ?> id="post-<?php the_ID(); ?>">
<div class="post-comments">
<?php if ( ! post_password_required() ) {
comments_popup_link( __( '0', 'desk-mess-mirrored' ), __( '1', 'desk-mess-mirrored' ), __( '%', 'desk-mess-mirrored' ), '',__( '-', 'desk-mess-mirrored' ) );
} ?>
</div>
<h1><a href="<?php the_permalink() ?>" rel="bookmark" title="<?php _e( 'Permanent Link to', 'desk-mess-mirrored' ); ?> <?php the_title_attribute(); ?>"><?php the_title(); ?></a></h1>
<div class="postdata">
<?php
/**
* for posts without titles - creates a permalink using the post date referencing the post ID
* @todo review - use the word Posted in place of the date?
* @todo make more i18n compatible ... `sprintf` or `printf`?
*/
if ( get_the_title() == "" ) {
_e( 'On ', 'desk-mess-mirrored' ); ?><a href="<?php the_permalink() ?>" rel="bookmark" title="<?php _e( 'Permanent Link to post ', 'desk-mess-mirrored' ); the_id(); ?>"><?php the_time( get_option( 'date_format' ) ); ?></a>
<?php } else {
_e( 'On ', 'desk-mess-mirrored' ); the_time( get_option( 'date_format' ) );
}
_e( ' in ', 'desk-mess-mirrored' ); the_category( ', ' ); edit_post_link( __( 'Edit', 'desk-mess-mirrored' ), __( ' | ', 'desk-mess-mirrored' ), __( '', 'desk-mess-mirrored' ) ); ?>
</div><!-- .postdata -->
<?php if ( $count == 1 ) :
the_content( __( ' ... continue reading. ', 'desk-mess-mirrored' ) ); ?>
<div class="clear"></div> <!-- For inserted media at the end of the post -->
<?php wp_link_pages( array( 'before' => '<p><strong>Pages:</strong> ', 'after' => '</p>', 'next_or_number' => 'number' ) ); ?>
<p class="single-meta"><?php the_tags(); ?></p>
<?php else :
the_excerpt();
endif; ?>
<div class="clear"></div> <!-- For inserted media at the end of the post -->
</div> <!-- .post #post-ID -->
<?php endwhile; ?>
<div id="nav-global" class="navigation">
<div class="left">
<?php next_posts_link( __( '« Previous entries', 'desk-mess-mirrored' ) ); ?>
</div>
<div class="right">
<?php previous_posts_link( __( 'Next entries »', 'desk-mess-mirrored' ) ); ?>
</div>
</div> <!-- .navigation -->
<?php else : ?>
<h2><?php printf( __( 'Search Results for: %s' ), '<span>' . esc_html( get_search_query() ) . '</span>' ); ?></h2>
<p class="center"><?php _e( 'Sorry, there are no posts by this author.', 'desk-mess-mirrored' ); ?></p>
<?php get_search_form();
endif; ?>
<!-- end the Loop -->
</div><!--end main blog-->
<?php get_sidebar(); ?>
<div class="clear"></div>
</div><!--end content-->
</div><!--end wrapper-->
<?php get_footer();?>