forked from YaleDHLab/dh-rees
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcategory-events.php
85 lines (76 loc) · 3.11 KB
/
category-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
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
77
78
79
80
81
82
83
84
85
<?php
/**
* The template for displaying all pages.
*
* This is the template that displays all pages by default.
* Please note that this is the WordPress construct of pages
* and that other 'pages' on your WordPress site may use a
* different template.
*
* @link https://codex.wordpress.org/Template_Hierarchy
*
* @package _s
*/
get_header(); ?>
<div id="primary" class="content-area">
<main id="main" class="site-main" role="main">
<!-- Featured project carosel -->
<?php $featured_item_type = 'featured-event';
include(locate_template( 'template-parts/featured-item-carousel.php') ); ?>
<!-- Upcoming Events column -->
<div class="upcoming-events-column">
<div class="upcoming-events-container">
<div class="upcoming-events-control-row">
<div class="subtitle-wrapper">
<div class="subtitle">UPCOMING EVENTS</div>
</div>
</div>
<?php $query = new WP_Query( array( 'category_name' => 'event' ) );
if ( $query->have_posts() ) : while ( $query->have_posts() ) : $query->the_post(); ?>
<!-- Display only non-featured events -->
<?php if (has_category('featured-event', $post)) {
continue;
} ?>
<div class="upcoming-event">
<div class="event-image-container">
<?php
$event_month = get_post_meta($post->ID, 'event-month', true);
$event_day = get_post_meta($post->ID, 'event-day', true);
if ( strlen($event_month) == 3 && strlen($event_day) > 0) {
echo '<div class="image-stripe event-stripe"></div>';
echo '<div class="event-stripe-text">';
echo '<div class="event-stripe-month">'.$event_month.'</div>';
echo '<div class="event-stripe-day">'.$event_day.'</div>';
echo '</div>';
} else {};
unset($event_month);
unset($event_day);
?>
<div class="showcase-project-thumbnail">
<img src="<?php the_post_thumbnail_url('large'); ?>"/>
</div>
</div><!--.event-image-container-->
<div class="event-text-container">
<div class="event-hover-strip"></div>
<div class="event-title"><?php the_title(); ?></div>
<div class="event-time-line">
<?php echo get_post_meta($post->ID, 'event-time-line', true); ?>
</div>
<div class="event-text">
<?php echo get_post_meta($post->ID, 'event-blurb', true); ?>
</div>
</div>
</div>
<?php endwhile; endif; ?>
<?php wp_reset_postdata(); ?>
</div>
</div>
<!-- Parallelograms -->
<div class="clear-both"></div>
<div class="events-parallelograms">
<?php get_template_part( 'template-parts/contact-parallelograms', 'none' ); ?>
<div>
</main><!-- #main -->
</div><!-- #primary -->
<?php
get_footer();