-
Notifications
You must be signed in to change notification settings - Fork 0
/
author.php
87 lines (63 loc) · 2.39 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
<?php
/**
*Template for displaying Author Archive pages.
*/
get_header(); ?>
<section id="container">
<div id="content" role="main">
<?php if ( have_posts() ) : ?>
<?php
/* Queue the first post, that way we know
* what author we're dealing with (if that is the case).
*
* We reset this later so we can run the loop
* properly with a call to rewind_posts().
*/
the_post();
?>
<header class="page-header">
<h1 class="page-title author">
<?php printf( __( 'Author Archives: %s', 'coffee' ), '<span class="vcard">' . get_the_author() . '</span>' ); ?></h1>
<?php
/* Since we called the_post() above, we need to
* rewind the loop back to the beginning that way
* we can run the loop properly, in full.
*/
rewind_posts();
endif;
?>
</header>
<?php if ( have_posts() ) : ?>
<?php /* Start the Loop */ ?>
<?php while ( have_posts() ) : the_post(); ?>
<?php
get_template_part( 'content', get_post_format() );
?>
<?php endwhile; ?>
<?php /* Display navigation to next/previous pages when applicable */ ?>
<?php if ( $wp_query->max_num_pages > 1 ) : ?>
<nav id="nav-below">
<div class="nav-previous">
<?php next_posts_link( __( '<span class="meta-nav">←</span> Older posts', 'coffee' ) ); ?>
</div>
<div class="nav-next">
<?php previous_posts_link( __( 'Newer posts <span class="meta-nav">→</span>', 'coffee' ) ); ?>
</div>
</nav>
<!-- end nav-below -->
<?php endif; ?>
<?php else : ?>
<article id="post-0" class="post no-results not-found">
<header class="entry-header">
<h1 class="entry-title"><?php _e( 'Nothing Found', 'coffee' ); ?></h1>
</header><!-- .entry-header -->
<div class="entry-content">
<p><?php _e( 'Apologies, but no results were found for the requested archive. Perhaps searching will help find a related post.', 'coffee' ); ?></p>
<?php get_search_form(); ?>
</div><!-- .entry-content -->
</article><!-- #post-0 -->
<?php endif; ?>
</div><!-- #content -->
</section><!-- #container -->
<?php get_sidebar(); ?>
<?php get_footer(); ?>