/
page-crew.php
121 lines (86 loc) · 2.47 KB
/
page-crew.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
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
<?php
/**
Template Name: Crew Page
**/
get_header(); ?>
<?php
while ( have_posts() ) : the_post();
get_template_part('template-parts/page', 'hero');
get_template_part('template-parts/page', 'content');
endwhile;
?>
<?php
$args = array(
'post_type' => 'crew',
'category_name' => 'executive-committee',
'posts_per_page' => -1
);
$the_query = new WP_Query( $args );
?>
<!-- set up counter to create new row after for every two crew members -->
<?php
$counter = 0;
?>
<section id="main" role="main" class ="crew">
<h3 class = "blue-title">Our Executive Committee</h3>
<div class="wide-container">
<div class="row">
<?php if ( $the_query->have_posts() ) : while ( $the_query->have_posts() ) : $the_query->the_post(); ?>
<div class="col-sm-6 col-xs-12 crew-member">
<h3><?php the_title(); ?></h3>
<div class = "crew-member-image">
<?php if ( has_post_thumbnail() ) { the_post_thumbnail('crew-member');} ?>
<h5><?php the_field('role'); ?></h5>
</div>
<div class ="crew-member-info">
<?php the_content(); ?>
</div>
</div>
<?php
$counter++;
if ($counter % 2 == 0) {
echo '</div><div class="row">';
}
endwhile; endif; ?>
<?php wp_reset_postdata(); ?>
</div>
</div>
</section><!-- .site-main -->
<?php
$args = array(
'post_type' => 'crew',
'category_name' => 'support-crew',
'posts_per_page' => -1
);
$the_query = new WP_Query( $args );
?>
<?php
$counter = 0;
?>
<section id="main" role="main" class ="crew">
<h3 class ="blue-title">Our Support Crew</h3>
<div class="wide-container">
<div class="row">
<?php if ( have_posts() ) : while ( $the_query->have_posts() ) : $the_query->the_post(); ?>
<div class="col-sm-6 col-xs-12 crew-member">
<h3><?php the_title(); ?></h3>
<div class = "crew-member-image">
<?php if ( has_post_thumbnail() ) { the_post_thumbnail('crew-member');} ?>
<h5><?php the_field('role'); ?></h5>
<p><?php the_field('crew_email'); ?></p>
</div>
<div class ="crew-member-info">
<?php the_content(); ?>
</div>
</div>
<?php
$counter++;
if ($counter % 2 == 0) {
echo '</div><div class="row">';
}
endwhile; endif; ?>
<?php wp_reset_postdata(); ?>
</div>
</div>
</section><!-- .site-main -->
<?php get_footer(); ?>