-
Notifications
You must be signed in to change notification settings - Fork 1
/
page-exhibits-past.php
76 lines (56 loc) · 2.03 KB
/
page-exhibits-past.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
74
75
76
<?php
/**
* Template Name: Exhibits | Past
*
* @package MIT_Libraries_Child
* @since Twenty Twelve 1.0
*/
get_header( 'child' );
?>
<?php get_template_part( 'inc/breadcrumbs', 'child' ); ?>
<div id="stage" class="inner" role="main">
<?php get_template_part( 'inc/postHead' ); ?>
<div id="content" class="content has-sidebar">
<div class="main-content">
<?php
$paged = ( get_query_var( 'paged' ) ) ? get_query_var( 'paged' ) : 1;
$past_query = new WP_Query(
array(
'post_type' => 'exhibits', // Only query events.
'meta_key' => 'end_date', // Load up the event_date meta.
'orderby' => 'end_date',
'order' => 'DESC', // Descending, so later events first.
'posts_per_page' => 10,
'paged' => $paged,
'meta_query' => array(
array(
'key' => 'end_date', // Which meta to query.
'value' => date( 'Y-m-d' ), // Value for comparison.
'compare' => '<', // Method of comparison.
'type' => 'DATE',
), // The meta_query is an array of query items.
), // End meta_query array.
) // End array.
); // Close WP_Query constructor call.
?>
<div class="exhibits-feed-section">
<h3 class="title-sub">Past Exhibits</h3>
<?php while ( $past_query->have_posts() ) : $past_query->the_post(); // Loop for events.
get_template_part( 'inc/exhibits-detail' );
wp_reset_postdata(); // Restore global post data stomped by the_post().
endwhile; // End of the loop. ?>
</div>
<!-- END OF PAST EXHIBITS LOOP -->
<ul class="post-navigation">
<li>
<?php previous_posts_link( 'Newer Posts' ) ?>
</li>
<li>
<?php next_posts_link( 'Older Posts', $past_query->max_num_pages ) ?>
</li>
</ul>
</div> <!-- main-content -->
<?php get_sidebar(); ?>
</div> <!-- content -->
</div> <!-- stage -->
<?php get_footer(); ?>