-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpage-past-events.php
51 lines (39 loc) · 1.04 KB
/
page-past-events.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
<?php
get_header();
pageBanner(array(
'title' => 'Past Events',
'subtitle' => 'A recap of our past events.'
));
?>
<div class="container container--narrow page-section">
<?php
$today = date('Ymd');
$pastEvents = new WP_Query(array(
// Second param is the fallback/default - if there isn't one, probably on the first page
'paged' => get_query_var('paged', 1),
'post_type' => 'event',
'meta_key' => 'event_date',
'orderby' => 'meta_value_num',
'order' => 'ASC',
'meta_query' => array(
// One inner array for each filter
array(
'key' => 'event_date',
'compare' => '<',
'value' => $today,
'type' => 'numeric'
),
)
));
while($pastEvents->have_posts()) {
$pastEvents->the_post();
get_template_part('template-parts/content-event');
}
echo paginate_links(array(
'total' => $pastEvents->max_num_pages
));
?>
</div>
<?php
get_footer();
?>