-
Notifications
You must be signed in to change notification settings - Fork 11
Expand file tree
/
Copy patharchive.php
More file actions
46 lines (34 loc) · 930 Bytes
/
Copy patharchive.php
File metadata and controls
46 lines (34 loc) · 930 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
34
35
36
37
38
39
40
41
42
43
44
45
46
<?php
/**
* @package WordPress
* @subpackage Jackpine
* @since Jackpine 0.1.0
*/
use Timber\PostQuery;
use Timber\Timber;
$context = Timber::context();
switch ($wp_query) {
case is_day():
$context['title'] = 'Archive: ' . get_the_date('D M Y');
break;
case is_month():
$context['title'] = 'Archive: ' . get_the_date('M Y');
break;
case is_year():
$context['title'] = 'Archive: ' . get_the_date('Y');
break;
case is_tag():
$context['title'] = single_tag_title('', false);
break;
case is_category():
$context['title'] = single_cat_title('', false);
break;
case is_post_type_archive():
$context['title'] = post_type_archive_title('', false);
break;
default:
$context['title'] = 'Archive';
break;
}
$context['posts'] = new PostQuery();
Timber::render('archive.twig', $context);