-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathpage-staff.php
More file actions
200 lines (162 loc) · 6.08 KB
/
Copy pathpage-staff.php
File metadata and controls
200 lines (162 loc) · 6.08 KB
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
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
<?php
/**
* Template Name: Staff Page
*
* @package WordPress
* @subpackage Twenty_Thirteen
* @since Twenty Thirteen 1.0
*/
get_header(); ?>
<div id="primary" class="content-area">
<div id="content" class="site-content" role="main">
<?php /* The loop */ ?>
<?php while ( have_posts() ) : the_post(); ?>
<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
<header class="entry-header">
<?php if ( has_post_thumbnail() && ! post_password_required() ) : ?>
<div class="entry-thumbnail">
<?php the_post_thumbnail(); ?>
</div>
<?php endif; ?>
<h1 class="entry-title"><?php the_title(); ?></h1>
</header><!-- .entry-header -->
<div class="entry-content">
<?php the_content(); ?>
<?php wp_link_pages( array( 'before' => '<div class="page-links"><span class="page-links-title">' . __( 'Pages:', 'opengovfoundation' ) . '</span>', 'after' => '</div>', 'link_before' => '<span>', 'link_after' => '</span>' ) ); ?>
<h1>Staff</h1>
<!-- Get all pages beneath this one -->
<?php $query = new WP_Query( array(
'post_parent' => $post->ID,
'post_type' => 'page',
'meta_key' => 'type',
'meta_value' => 'Staff'
) );?>
<?php /* Check to see if we have results */ ?>
<?php if ( $query->have_posts() ) : ?>
<section class="staff-list">
<?php while ( $query->have_posts() ) : ?>
<?php $query->the_post(); ?>
<div class="person">
<h2><?php print get_the_title() ?></h2>
<h3><?php print get_post_meta($post->ID, 'position', true); ?></h3>
</div>
<?php endwhile; ?>
</section>
<?php /* Rewind our query to the beginning */ ?>
<?php $query->rewind_posts() ?>
<!-- Details about each person for popup -->
<section class="staff-details" style="display: none">
<?php while ( $query->have_posts() ) : ?>
<?php $query->the_post(); ?>
<article class="person">
<?php if( has_post_thumbnail() ) : ?>
<!-- show a 200x200px thumbnail -->
<?php print the_post_thumbnail( array(200,200) ); ?>
<?php endif; ?>
<h2><?php print the_title() ?></h2>
<h3><?php print get_post_meta($post->ID, 'position', true); ?></h3>
<section class="bio">
<?php print the_content(); ?>
</section>
</article>
<?php endwhile; ?>
</section>
<?php else: ?>
No staff found.
<?php endif; ?>
<?php wp_reset_postdata(); ?>
<h1>Board of Directors</h1>
<!-- Get all pages beneath this one -->
<?php $query = new WP_Query( array(
'post_parent' => $post->ID,
'post_type' => 'page',
'meta_key' => 'type',
'meta_value' => 'Board'
) );?>
<?php /* Check to see if we have results */ ?>
<?php if ( $query->have_posts() ) : ?>
<section class="staff-list">
<?php while ( $query->have_posts() ) : ?>
<?php $query->the_post(); ?>
<div class="person">
<h2><?php print get_the_title() ?></h2>
<h3><?php print get_post_meta($post->ID, 'position', true); ?></h3>
</div>
<?php endwhile; ?>
</section>
<?php /* Rewind our query to the beginning */ ?>
<?php $query->rewind_posts() ?>
<!-- Details about each person for popup -->
<section class="staff-details" style="display: none">
<?php while ( $query->have_posts() ) : ?>
<?php $query->the_post(); ?>
<article class="person">
<?php if( has_post_thumbnail() ) : ?>
<!-- show a 200x200px thumbnail -->
<?php print the_post_thumbnail( array(200,200) ); ?>
<?php endif; ?>
<h2><?php print the_title() ?></h2>
<h3><?php print get_post_meta($post->ID, 'position', true); ?></h3>
<section class="bio">
<?php print the_content(); ?>
</section>
</article>
<?php endwhile; ?>
</section>
<?php else: ?>
No staff found.
<?php endif; ?>
<?php wp_reset_postdata(); ?>
<h1>Advisory Board</h1>
<!-- Get all pages beneath this one -->
<?php $query = new WP_Query( array(
'post_parent' => $post->ID,
'post_type' => 'page',
'meta_key' => 'type',
'meta_value' => 'Advisory Board'
) );?>
<?php /* Check to see if we have results */ ?>
<?php if ( $query->have_posts() ) : ?>
<section class="staff-list">
<?php while ( $query->have_posts() ) : ?>
<?php $query->the_post(); ?>
<div class="person">
<h2><?php print get_the_title() ?></h2>
<h3><?php print get_post_meta($post->ID, 'position', true); ?></h3>
</div>
<?php endwhile; ?>
</section>
<?php /* Rewind our query to the beginning */ ?>
<?php $query->rewind_posts() ?>
<!-- Details about each person for popup -->
<section class="staff-details" style="display: none">
<?php while ( $query->have_posts() ) : ?>
<?php $query->the_post(); ?>
<article class="person">
<?php if( has_post_thumbnail() ) : ?>
<!-- show a 200x200px thumbnail -->
<?php print the_post_thumbnail( array(200,200) ); ?>
<?php endif; ?>
<h2><?php print the_title() ?></h2>
<h3><?php print get_post_meta($post->ID, 'position', true); ?></h3>
<section class="bio">
<?php print the_content(); ?>
</section>
</article>
<?php endwhile; ?>
</section>
<?php else: ?>
No staff found.
<?php endif; ?>
<?php wp_reset_postdata(); ?>
</div><!-- .entry-content -->
<footer class="entry-meta">
<?php edit_post_link( __( 'Edit', 'opengovfoundation' ), '<span class="edit-link">', '</span>' ); ?>
</footer><!-- .entry-meta -->
</article><!-- #post -->
<?php comments_template(); ?>
<?php endwhile; ?>
</div><!-- #content -->
</div><!-- #primary -->
<?php get_sidebar(); ?>
<?php get_footer(); ?>