-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpage-past-events.php
45 lines (35 loc) · 936 Bytes
/
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
<?php
get_header();
page_banner(array(
'title' => 'Past Events',
'subtitle' => 'Recapping our past events...'
));
?>
<div class="container container--narrow page-section">
<?php
$today = date('Ymd');
$past_events = new WP_Query(array(
'paged' => get_query_var('paged', 1),
'post_type' => 'event',
'meta_key' => 'event_date',
'orderby' => 'meta_value_num',
'order' => 'ASC',
'meta_query' => array(
array(
'key' => 'event_date',
'compare' => '<=',
'value' => $today,
'type' => 'numeric'
)
),
));
while ($past_events->have_posts()) {
$past_events->the_post();
get_template_part('template-parts/content', 'event');
}
echo paginate_links(array(
'total' => $past_events->max_num_pages
));
?>
</div>
<?php get_footer() ?>