-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathauthor.php
More file actions
31 lines (27 loc) · 833 Bytes
/
author.php
File metadata and controls
31 lines (27 loc) · 833 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
<?php
/**
* The template for displaying Author Archive pages
*
* Methods for TimberHelper can be found in the /lib sub-directory
*
*/
use Timber\Timber;
use tp\TenthTemplate\Exultant;
use tp\TouchPointWP\Person;
global $wp_query;
$context = Timber::context();
require 'commonContext.php';
$context['posts'] = Timber::get_posts();
$context['type'] = "Person";
if ( isset( $wp_query->query_vars['author'] ) ) {
$person = Person::fromId($wp_query->query_vars['author']);
if ($person !== null) {
$context['person'] = $person;
$context['title'] = $person->display_name;
Exultant::render(['templates/person.twig', 'archive.twig'], $context);
} else {
Exultant::render(['templates/404.twig'], $context);
}
} else {
Exultant::render(['templates/404.twig'], $context);
}