-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpage-members.php
210 lines (142 loc) · 8.06 KB
/
page-members.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
<?php
/**
* Template Name: Team Members
* Template Post Type: page
*
* @package WordPress
* @subpackage UWS Media
* @since 1.0.0
*/
get_header(); ?>
<?php while ( have_posts() ) : the_post(); ?>
<div class="header-banner">
<div class="container">
<h1 class="banner-title"><?php
$pageTitle = get_post_meta( get_the_ID(), 'banner_title' , true );
the_title();
?></h1>
<div class="banner-content">
<?php echo html_entity_decode( get_post_meta( get_the_ID(), 'banner_content' , true ) ); ?></div>
</div>
</div>
<main class="container pt-4" role="main">
<section>
<div class="entry-content-page">
<?php if ( has_post_thumbnail() ) : ?>
<img src="<?php the_post_thumbnail_url(); ?>" alt="" />
<?php endif; ?>
<?php the_content(); ?>
</div>
</section>
<?php
endwhile;
wp_reset_query();
?>
<section id="member-archive">
<div class="row d-flex">
<?php
$query_args = array(
'post_type' => 'uws-team-members',
'post_status' => 'publish',
'posts_per_page' => -1,
'meta_query' => array(
'show_first' => array(
'key' => 'show_first',
'value' => array( 0, 1 ),
'compare' => 'IN'
)
),
'order' => 'ASC',
'orderby' => array(
'show_first' => 'DESC',
'title' => 'ASC'
)
);
$members = new WP_Query( $query_args );
if ( $members->have_posts() ) :
while( $members->have_posts() ) : $members->the_post();
?>
<div class="col-12 col-sm-12 col-md-6 col-lg-4 member">
<div class="card h-100">
<?php
if ( has_post_thumbnail() ) :
the_post_thumbnail( 'post-thumbnail', [
'class' => 'card-img-top',
'alt' => 'Photo of ' . get_the_title()
] );
else:
?>
<div class="no-pic d-flex align-items-center justify-content-center"></div>
<?php endif; ?>
<div class="card-body d-flex flex-column">
<h5 class="card-title"><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h5>
<p class="card-text text-muted member-title">
<?php echo get_post_meta( get_the_ID(), 'job_title', true ); ?><br>
<a
href="https://media.uwex.edu/content/uwex/resources/pronouns-usage-guide.pdf" target="_blank" referrerpolicy="no-referrer"><?php echo get_post_meta( get_the_ID(), 'pronouns', true ); ?></a>
</p>
<p class="card-text member-excerpt"><?php the_excerpt(); ?></p>
<?php
$interestStr = get_post_meta( get_the_ID(), 'member_interests' )[0];
if ( !empty( $interestStr ) ) :
?>
<p class="card-text text-center text-muted member-interests">
<?php
$interests = array_filter( explode( ',', $interestStr ) );
$count = 0;
foreach( $interests as $interest ) :
echo ucwords( trim( $interest ) );
$count++;
if ( $count < count( $interests ) ) {
echo ' • ';
}
endforeach;
?>
</p>
<?php endif; ?>
</div>
<div class="card-footer text-center social-icons">
<?php
$linkedIn = get_post_meta( get_the_ID(), 'linkedin_username', true );
if ( !empty( $linkedIn ) ) {
echo '<a class="btn btn-link" href="https://www.linkedin.com/in/' . $linkedIn . '" target="_blank"><i class="bi bi-linkedin"><span class="screen-reader-text">LinkedIn Profile Link</span></i></a>';
}
$twitter = get_post_meta( get_the_ID(), 'twitter_username', true );
if ( !empty( $twitter ) ) {
echo '<a class="btn btn-link" href="https://twitter.com/' . $twitter . '" target="_blank"><i class="bi bi-twitter"><span class="screen-reader-text">Twitter Profile Link</span></i></a>';
}
$facebook = get_post_meta( get_the_ID(), 'facebook_username', true );
if ( !empty( $facebook ) ) {
echo '<a class="btn btn-link" href="https://www.facebook.com/' . $facebook . '" target="_blank"><i class="bi bi-facebook"><span class="screen-reader-text">Facebook Profile Link</span></i></a>';
}
$youtube = get_post_meta( get_the_ID(), 'youtube_username', true );
if ( !empty( $youtube ) ) {
echo '<a class="btn btn-link" href="https://www.youtube.com/user/' . $youtube . '" target="_blank"><i class="bi bi-youtube"><span class="screen-reader-text">YouTube Profile Link</span></i></a>';
}
$behance = get_post_meta( get_the_ID(), 'behance_username', true );
if ( !empty( $behance ) ) {
echo '<a class="btn btn-link" href="https://www.behance.net/' . $behance . '" target="_blank"><i class="bi bi-behance"><span class="screen-reader-text">Béhance Profile Link</span></i></a>';
}
$github = get_post_meta( get_the_ID(), 'github_username', true );
if ( !empty( $github ) ) {
echo '<a class="btn btn-link" href="https://github.com/' . $github . '" target="_blank"><i class="bi bi-github"><span class="screen-reader-text">GitHub Profile Link</span></i></a>';
}
?>
</div>
</div>
</div>
<?php
endwhile;
wp_reset_postdata();
?>
</div>
<?php else: ?>
<div class="alert alert-light col-12" role="alert">
<h2 class="text-center">😱<br>No Members To Show</h2>
<hr>
<p class="text-center">Members will show up here after members are added.</p>
</div>
<?php endif; ?>
</section>
</main>
<?php get_footer(); ?>