-
-
+
+
-
- 10,
- 'ignore_sticky_posts' => false,
- 'post_type' => 'exhibits', // Only query exhibits.
- 'meta_key' => 'start_date', // Load up the event_date meta.
- 'orderby' => 'start_date',
- 'order' => 'DESC', // Descending, so later events first.
- 'meta_query' => array( // The meta_query is an array of query items.
- array(
- 'key' => 'start_date', // Which meta to query.
- 'value' => gmdate( 'Y-m-d' ), // Value for comparison.
- 'compare' => '<=', // Method of comparison.
- 'type' => 'DATE',
- ),
- array(
- 'relation' => 'OR',
- array(
- 'key' => 'end_date', // Which meta to query.
- 'value' => gmdate( 'Y-m-d' ), // Value for comparison.
- 'compare' => '>=', // Method of comparison.
- 'type' => 'DATE',
- ),
- array(
- 'key' => 'end_date', // Which meta to query.
- 'value' => '', // Value for comparison.
- 'compare' => '=', // Method of comparison.
- 'type' => 'CHAR',
- ),
- ),
- ), // End meta_query array.
- ) // End array.
- ); // Close WP_Query constructor call.
- ?>
+
-
-
+
+
-
-
+
-
- $future_query = new \WP_Query(
- array(
- 'post_type' => 'exhibits', // Only query exhibits.
- 'meta_key' => 'start_date', // Load up the event_date meta.
- 'orderby' => 'start_date',
- 'order' => 'ASC',
- 'posts_per_page' => 10, // Descending, so later events first.
- 'meta_query' => array(
- array(
- 'key' => 'start_date', // Which meta to query.
- 'value' => gmdate( '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.
- ?>
-
-
-
-
- Current Exhibits
- + have_posts() ) : - while ( $current_query->have_posts() ) : + if ( $current_query->have_posts() ) { + while ( $current_query->have_posts() ) { $current_query->the_post(); // Loop for current exhibits. get_template_part( 'inc/exhibits-detail' ); + }; + wp_reset_postdata(); + } else { + echo 'There are no current exhibit announcements at this time. New exhibits are added throughout the year, so please check back.
'; + } + ?> - endwhile; - - wp_reset_postdata(); - - else : - ?> - - - - -
-
+
-
-
+
-
-
- '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' => 5,
- 'meta_query' => array(
- array(
- 'key' => 'end_date', // Which meta to query.
- 'value' => gmdate( '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.
- ?>
+
+
Upcoming Exhibits
- + have_posts() ) : - while ( $future_query->have_posts() ) : + if ( $future_query->have_posts() ) { + while ( $future_query->have_posts() ) { $future_query->the_post(); // Loop for future exhibits. get_template_part( 'inc/exhibits-detail' ); - - endwhile; - + }; wp_reset_postdata(); + } else { + echo 'There are no upcoming exhibit announcements at this time. New exhibits are added throughout the year, so please check back.
'; + } + ?> - else : - ?> - - - - -
-
+
@@ -175,15 +153,13 @@
View all past exhibits
-
-
-
-