-
Notifications
You must be signed in to change notification settings - Fork 107
Expand file tree
/
Copy pathauthor.php
More file actions
33 lines (23 loc) · 749 Bytes
/
author.php
File metadata and controls
33 lines (23 loc) · 749 Bytes
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
<?php
get_header();
$paged = ( get_query_var( 'paged' ) ) ? get_query_var( 'paged' ) : 1;
$per_page = RADL::get( 'state.site' )['posts_per_page'];
$author_id = get_query_var( 'author' );
$author = RADL::get( 'state.users', $author_id );
$posts = RADL::get( 'state.posts', array( 'page' => $paged, 'per_page' => $per_page, 'author' => $author_id ) ); ?>
<main>
<header>
<h1>Posts by <?php echo $author['name']; ?></h1>
</header>
<section>
<?php
foreach ( $posts as $p ) {
set_query_var( 'vw_post', $p );
get_template_part( 'template-parts/post-item' );
} ?>
</section>
<?php
get_template_part( 'template-parts/pagination' ); ?>
</main>
<?php
get_footer();