-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpage-instructors.php
100 lines (79 loc) · 3.48 KB
/
page-instructors.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
<?php
// template for displaying instructors
// all other pages will default to page.php. These pages are useful in that the client cannot change the content on these pages. The content is hard-coded therefore un-editable.
//Please note that this is a wordpress construct of pages and that other 'pages' on your wordpress site may use a different template.
//@link https://developer.wordpress.org/themes/basics/template-hierarchy/
//@package parkland-theme
?>
<?php get_header(); ?>
<main>
<div class="instructors-page-container">
<div class="instructors-banner">
<h1>
Instructors
<img src="/wp-content/themes/parkland-theme/images/banner-underline.png" alt="styled brush stroke">
</h1>
</div>
</div>
<div class="instructors-section">
<h2>
Meet Our Instructors
<img src="/wp-content/themes/parkland-theme/images/brushstroke.svg" alt="styled brush stroke">
</h2>
<?php
$args = array(
'post_type' => 'parkland-instructors',
'posts_per_page' => 15,
'order' => 'ASC',
);
$loop = new WP_Query($args);
$layout1 = '<div class="instructor-container-1">%s</div>';
$layout2 = '<div class="instructor-container-2">%s</div>';
if ($loop->have_posts()) {
$counter = 0;
while ( $loop->have_posts() ) {
$loop->the_post();
if ($counter % 2 == 0) {
?>
<div class="instructor-container-1">
<div class="instructor-image">
<?php
get_field('instructor_content');
?>
<?php if( get_field('instructor_image') ): ?>
<img src="<?php the_field('instructor_image'); ?>" width="580" height="380" />
<?php endif; ?>
</div>
<div class="instructor-information">
<h3><?php the_title(); ?></h3>
<h4>Instructor Information</h4>
<?php the_field('instructor_content'); ?>
</div>
</div>
<?php
} else {
?>
<div class="instructor-container-2">
<div class="instructor-image">
<?php
get_field('instructor_content');
?>
<?php if( get_field('instructor_image') ): ?>
<img src="<?php the_field('instructor_image'); ?>" width="580" height="380" />
<?php endif; ?>
</div>
<div class="instructor-information">
<h3><?php the_title(); ?></h3>
<h4>Instructor Information</h4>
<?php the_field('instructor_content'); ?>
</div>
</div>
<?php
}
$counter++;
}
}
?>
</div>
</main>
<?php get_footer(); ?>