forked from kushinauwu/OBF-Homepage-New
-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathindex.php
377 lines (345 loc) · 15.8 KB
/
index.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
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
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
<?php get_header(); ?>
<!--main content start -->
<div class="showcase-wrapper">
<!--about OBF -->
<!-- Search for post tagged accordingly -->
<?php $query0 = new WP_Query( array( 'tag' => 'index-about' ) ); ?>
<!-- if exists -->
<?php if($query0->have_posts()) : ?>
<?php while($query0->have_posts()) : $query0->the_post(); ?>
<section class="about-section">
<div class="row">
<div class="col-sm-5">
<div class="about-text-wrapper">
<div class="about-content">
<h1>
<?php the_title(); ?>
</h1>
<div class="about-content-wrapper">
<div class="about-content-info">
<?php the_content(); ?>
<div class="about-content-button">
<a href="about" class="button">
<span>
Learn More </span>
</a>
</div>
<!--button class end -->
</div> <!-- actual content info end -->
</div>
<!--content wrapper end -->
</div>
</div> <!-- text wrapper end -->
</div>
<div class="col-sm-7">
<div class="about-background-image">
<!--Photo by Egor Kamelev from Pexels-->
<img src="<?php echo get_bloginfo('template_url') ?>/img/abstract-animal-aquarium-753266.jpg">
</div>
</div>
</div>
</section>
<?php endwhile; ?>
<?php wp_reset_postdata(); ?>
<?php else : ?>
<p>
<?php __('No post found'); ?>
</p>
<?php endif; ?>
<!-- about OBF end -->
<!-- news/blog section -->
<?php $query1 = new WP_Query( array( 'tag' => 'index-news' ) ); ?>
<?php if($query1->have_posts()) : ?>
<?php while($query1->have_posts()) : $query1->the_post(); ?>
<section class="news-section">
<div class="news-image" style="background-image: url(<?php echo get_bloginfo('template_url') ?>/img/aquatic-plants-background-beautiful-424763.jpg);">
<!--Photo by Fancycrave.com from Pexels-->
</div>
<div class="container">
<div class="row">
<!--move content by 5 columns -->
<div class="col-md-7 col-md-offset-5">
<h1>
<?php the_title(); ?>
</h1>
<?php the_content(); ?>
<div class="news-button">
<a href="blog" class="button">
<span>Read More</span>
</a>
</div> <!-- news button end -->
</div>
</div>
</div>
</section> <!-- news section end -->
<?php endwhile; ?>
<?php wp_reset_postdata(); ?>
<?php else : ?>
<p>
<?php __('No post found'); ?>
</p>
<?php endif; ?>
<!--fellowships section -->
<?php $query2 = new WP_Query( array( 'tag' => 'index-fellowships' ) ); ?>
<?php if($query2->have_posts()) : ?>
<?php while($query2->have_posts()) : $query2->the_post(); ?>
<section class="fellowships-section">
<div class="row">
<div class="col-sm-6">
<div class="fellowships-text-wrapper">
<div class="fellowships-content">
<h1>
<?php the_title(); ?>
</h1>
<div class="fellowships-content-wrapper">
<div class="fellowships-content-info">
<?php the_content(); ?>
<div class="fellowships-apply-button">
<a href="fellowships#fellowships-applications" class="button">
<span>
Apply </span>
</a>
</div> <!-- apply button end -->
</div> <!-- text content ends -->
</div> <!-- content wrapper end -->
</div>
</div> <!-- text wrappper end -->
</div>
<div class="col-sm-6">
<div class="fellowships-background-image">
<!--Photo by Hiếu Hoàng from Pexels-->
<img src="<?php echo get_bloginfo('template_url') ?>/img/biology-blur-close-up-760184.jpg">
</div>
</div>
</div>
</section> <!-- fellowships section end -->
<?php endwhile; ?>
<?php wp_reset_postdata(); ?>
<?php else : ?>
<p>
<?php __('No post found'); ?>
</p>
<?php endif; ?>
<!-- Projects Section -->
<?php $project_query = new WP_Query( array( 'tag' => 'index-projects' ) ); ?>
<?php while($project_query -> have_posts()) : $project_query -> the_post(); ?>
<section class="projects-section">
<div class="container-fluid">
<div class="row">
<div class="col-xs-12">
<div class="projects-text-wrapper">
<h1>
<?php the_title(); ?>
</h1>
</div>
<!-- list of linked projects -->
<ul class="list-inline row projects-list">
<div class="col-sm-4 col-xs-6">
<li class="project-name">
<a href="#">
<?php $image = wp_get_attachment_image_src(get_field('project_logo_1'), 'full'); ?>
<img src="<?php echo $image[0]; ?>" />
<div class="project-title">
<?php the_field('project_name_1'); ?>
</div>
</a>
</li>
</div>
<div class="col-sm-4 col-xs-6">
<li class="project-name">
<a href="#">
<?php $image = wp_get_attachment_image_src(get_field('project_logo_2'), 'full'); ?>
<img src="<?php echo $image[0]; ?>" />
<div class="project-title">
<?php the_field('project_name_2'); ?>
</div>
</a>
</li>
</div>
<div class="col-sm-4 col-xs-6">
<li class="project-name">
<a href="#">
<?php $image = wp_get_attachment_image_src(get_field('project_logo_3'), 'full'); ?>
<img src="<?php echo $image[0]; ?>" />
<div class="project-title">
<?php the_field('project_name_3'); ?>
</div>
</a>
</li>
</div>
<div class="col-sm-4 col-xs-6">
<li class="project-name">
<a href="#">
<?php $image = wp_get_attachment_image_src(get_field('project_logo_4'), 'full'); ?>
<img src="<?php echo $image[0]; ?>" />
<div class="project-title">
<?php the_field('project_name_4'); ?>
</div>
</a>
</li>
</div>
<div class="col-sm-4 col-xs-6">
<li class="project-name">
<a href="#">
<?php $image = wp_get_attachment_image_src(get_field('project_logo_5'), 'full'); ?>
<img src="<?php echo $image[0]; ?>" />
<div class="project-title">
<?php the_field('project_name_5'); ?>
</div>
</a>
</li>
</div>
<div class="col-sm-4 col-xs-6">
<li class="project-name">
<a href="#">
<?php $image = wp_get_attachment_image_src(get_field('project_logo_6'), 'full'); ?>
<img src="<?php echo $image[0]; ?>" />
<div class="project-title">
<?php the_field('project_name_6'); ?>
</div>
</a>
</li>
</div>
</ul>
</div>
</div>
<div class="row">
<div class="col-xs-12 projects-button">
<a href="projects" class="button">
<span> See more projects</span>
</a>
</div>
</div>
</div>
</section> <!-- projects section end -->
<?php endwhile; ?>
<?php wp_reset_postdata(); ?>
<!--EVENTS SECTION -->
<section class="events-section">
<div class="container-fluid">
<div class="row">
<div class="col-xs-12">
<div class="events-head-wrapper">
<h1>Upcoming events</h1>
</div>
<?php $event_query = new WP_Query( array(
'tag' => 'index-events',
'posts_per_page' => 3) ); ?>
<ul class="list-inline row events-list">
<?php while($event_query -> have_posts()) : $event_query -> the_post(); ?>
<div class="col-sm-4 col-xs-4">
<li class="event-details">
<a href="#">
<?php the_post_thumbnail(); ?>
<div class="event-name">
<?php the_title(); ?>
</div>
<div class="event-date">
<?php
//check if value in field is for event Date
$event_date = get_post_meta($post->ID, 'Date', true ); ?>
<?php if ( $event_date ) : echo $event_date; ?>
<?php else : ?>
<p>
<?php __('TBA'); ?>
</p>
<?php endif; ?>
<?php wp_reset_postdata(); ?>
</div>
</a>
</li>
</div>
<?php endwhile; ?>
<?php wp_reset_postdata(); ?>
</ul>
</div>
</div>
</div>
</section>
<!-- Board of Directors -->
<section class="board-section">
<div class="container-fluid">
<div class="row">
<div class="col-xs-12">
<div class="board-head-wrapper">
<h1>Board of directors</h1>
</div>
</div>
<ul class="list-inline row member-list">
<?php
$args = array(
'post_type' => 'obf-board',
'tax_query' => array(
array (
'taxonomy' => 'member-type',
'field' => 'slug',
'terms' => 'current-member',
)
),
);
$present_member = new WP_Query( $args );
?>
<?php if ( $present_member->have_posts() ) : while ( $present_member->have_posts() ) : $present_member->the_post(); ?>
<div class="col-sm-4 col-xs-4">
<li class="member-details">
<?php the_post_thumbnail(); ?>
<div class="member-name">
<?php $member_url = get_post_meta( get_the_ID(), 'external_url', true ); ?>
<a href="<?php echo $member_url; ?>" target="_blank">
<?php the_title(); ?></a>
</div>
<div class="member-position">
<?php the_field('member_position'); ?>
</div>
</li>
</div>
<?php endwhile; else : ?>
<p>
<?php __('No post found'); ?>
</p>
<?php endif;
wp_reset_postdata(); ?>
</ul>
</div>
</div>
<div class="row">
<div class="col-xs-12 board-button">
<a href="board" class="button">
<span> See all members</span>
</a>
</div>
</div>
</section>
<!-- Join section -->
<section class="join-section">
<div class="container-fluid">
<div class="row">
<div class="col-xs-12">
<div class="join-head-wrapper">
<h1>Join Us!</h1>
</div>
<?php $joining_query = new WP_Query( array( 'tag' => 'index-join',
'posts_per_page' => 3 ) ); ?>
<ul class="list-inline row join-list">
<?php while($joining_query -> have_posts()) : $joining_query -> the_post(); ?>
<div class="col-sm-4 col-xs-4">
<li class="join-details">
<a href="#">
<?php the_post_thumbnail(); ?>
<div class="join-title">
<?php the_title(); ?>
</div>
</a>
</li>
</div>
<?php endwhile; ?>
<?php wp_reset_postdata(); ?>
</ul>
</div>
</div>
</div>
</section>
</div>
<!--main content end -->
<!--footer -->
<?php get_footer(); ?>