-
Notifications
You must be signed in to change notification settings - Fork 0
/
archive-member.php
73 lines (64 loc) · 2.13 KB
/
archive-member.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
<?php
get_header();
// Get composers names, photos and permalinks
$today = date('Ymd', strtotime('-1 day'));
$members = get_posts(array(
'numberposts' => -1,
'post_type' => 'member',
'orderby' => 'title',
'order' => 'ASC',
'meta_query' => array(
'relation' => 'OR',
array(
'key' => 'dtend',
'value' => null
),
array(
'key' => 'dtend',
'value' => $today,
'type' => 'numeric',
'compare' => '>'
)
)
));
echo '<article>';
if ($members) {
echo component('member_list', array(
"members" => $members
));
}
// Get graduated composers names, photos and permalinks
$today = date('Ymd', strtotime('-1 day'));
$past_members = get_posts(array(
'numberposts' => -1,
'post_type' => 'member',
'meta_key' => 'dtend',
'orderby' => 'meta_value_num',
'order' => 'DESC',
'meta_query' => array(
'relation' => 'AND',
array(
'key' => 'dtend',
'value' => '',
'compare' => '!=' // Exclude posts where field is not set
),
array(
'key' => 'dtend',
'value' => $today,
'type' => 'numeric',
'compare' => '<'
)
)
));
if ($past_members) {
echo component('member_list', array(
"members" => $past_members,
"heading" => 'Past Members',
"show_image" => false
));
}
if (!$members && !$past_members) {
echo '<section class="composers p-section"><h2>Composers</h2><p>I’m afraid it looks like there aren’t any composers to show you yet.</p>';
}
echo '</article>';
get_footer();