forked from ejohann/fictional-university-theme
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpage-past-events.php
40 lines (36 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
<?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(
'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($pastEvents->have_posts()){
$pastEvents->the_post();
get_template_part('template-parts/content-event');
}
echo paginate_links(array(
'total' => $pastEvents->max_num_pages
));
wp_reset_postdata();
?>
</div>
<?php get_footer(); ?>