-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy patharchive-staff.php
172 lines (166 loc) · 8.48 KB
/
archive-staff.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
<?php
/*
Description: Archive staff member page.
*/
?>
<?php
$args=array(
'post_type' => 'staff',
'posts_per_page' => 1000,
'orderby' => 'title',
'order' => 'ASC');
$my_query = null;
$my_query = new WP_Query($args);
?>
<?php get_header(); ?>
<div id="main">
<div id="title_bar" class="container">
<div class="row">
<div class="col-sm-8">
<header><h1>Staff Directory</h1></header>
<?php if (function_exists('dimox_breadcrumbs')) dimox_breadcrumbs(); ?>
</div><!-- col-sm-8 -->
<div class="col-sm-4">
<div class="header-search"><?php get_search_form(); ?></div>
</div><!-- col-sm-4 -->
</div><!-- row -->
</div><!-- container -->
<div class="background-color-gray">
<div id="content" class="container">
<div class="row">
<div id="sidebar" class="col-sm-3">
<?php get_sidebar('staff'); ?>
</div><!-- col-sm-3 -->
<div id="content_area" class="col-sm-9">
<h2 class="subpage-title">All Staff</h2>
<div class="btn-group btn-grid-list" data-toggle="buttons" role="group" aria-label="format">
<label class="btn btn-primary view-button active">
<input type="radio" name="views" autocomplete="off" value="grid" checked><i class="fa fa-th"></i> Grid
</label>
<label class="btn btn-primary view-button">
<input type="radio" name="views" autocomplete="off" value="list"> <i class="fa fa-th-list"></i> List
</label>
</div>
<div id="list_view" class="view">
<div class="card">
<div class="table-responsive">
<table class="table table-striped table-sorter">
<thead>
<tr>
<th class="empty-cell"><span class="sr-only">Staff Image</span></th>
<th><span class="glyphicon glyphicon-user"></span> Name</th>
<th><i class="fa fa-bookmark"></i> Title</th>
<th><i class="fa fa-graduation-cap"></i> Rank</th>
<th><i class="fa fa-university"></i> Department</th>
<th style="min-width: 10em;"><span class="glyphicon glyphicon-phone-alt"></span> Phone</th>
<th style="min-width: 6em;"><i class="fa fa-envelope"></i> Email</th>
</tr>
</thead>
<tbody>
<?php if ($my_query->have_posts()) : while ($my_query->have_posts()) : $my_query->the_post(); ?>
<tr>
<td><a href="<?php echo get_permalink(); ?>"><?php the_post_thumbnail('thumbnail', array('class' => 'list-thumbnail')); ?></a></td>
<td><a href="<?php echo get_permalink(); ?>"><?php the_title(); ?></a></td>
<td>
<?php if(get_post_meta($post->ID, 'title', true)): ?>
<?php echo get_post_meta($post->ID, 'title', true); ?>
<?php endif; ?>
</td>
<td>
<?php if(get_post_meta($post->ID, 'rank', true)): ?>
<?php echo get_post_meta($post->ID, 'rank', true); ?>
<?php endif; ?>
</td>
<td>
<?php if(get_the_term_list( $post->ID, 'department', true)): ?>
<?php echo get_the_term_list( $post->ID, 'department', '', ', ', '' ); ?>
<?php endif; ?>
</td>
<td>
<?php if(get_post_meta($post->ID, 'phone', true)): ?>
<?php echo get_post_meta($post->ID, 'phone', true); ?>
<?php endif; ?>
</td>
<td>
<?php if(get_post_meta($post->ID, 'email', true)): ?>
<a href="mailto:<?php echo get_post_meta($post->ID, 'email', true); ?>">Email</a>
<?php endif; ?>
</td>
</tr>
<?php endwhile; else: ?>
<tr>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<?php endif; ?>
</tbody>
</table>
</div>
</div>
</div>
<div id="grid_view" class="directory row view view-active">
<?php $i = 0; ?>
<?php if ($my_query->have_posts()) : while ($my_query->have_posts()) : $my_query->the_post(); ?>
<?php $i++; ?>
<div class="col-xs-6 col-md-4 col-lg-3">
<div class="thumbnail">
<figure><a href="<?php echo get_permalink(); ?>"><?php the_post_thumbnail('staff-thumbnail', array('class' => 'staff-thumbnail')); ?></a></figure>
<div class="caption">
<h3><a href="<?php echo get_permalink(); ?>"><?php the_title(); ?></a></h3>
<?php if(get_post_meta($post->ID, 'title', true) ||
get_post_meta($post->ID, 'rank', true) ||
get_post_meta($post->ID, 'department', true) ||
get_post_meta($post->ID, 'subject', true) ||
get_post_meta($post->ID, 'room', true) ||
get_post_meta($post->ID, 'phone', true) ||
get_post_meta($post->ID, 'email', true)
): ?>
<ul>
<?php if(get_post_meta($post->ID, 'title', true)): ?>
<li><i class="fa fa-bookmark" data-toggle="tooltip" data-placement="right" title="Title"></i><?php echo get_post_meta($post->ID, 'title', true); ?></li>
<?php endif; ?>
<?php if(get_post_meta($post->ID, 'rank', true)): ?>
<li><i class="fa fa-graduation-cap" data-toggle="tooltip" data-placement="right" title="Rank"></i><?php echo get_post_meta($post->ID, 'rank', true); ?></li>
<?php endif; ?>
<?php if(get_the_term_list( $post->ID, 'department', true)): ?>
<li><i class="fa fa-university" data-toggle="tooltip" data-placement="right" title="Department"></i><?php echo get_the_term_list( $post->ID, 'department', '', ', ', '' ); ?></li>
<?php endif; ?>
<?php if(get_post_meta($post->ID, 'room', true)): ?>
<li><span class="glyphicon glyphicon-map-marker" data-toggle="tooltip" data-placement="right" title="Location"></span> <?php echo get_post_meta($post->ID, 'room', true); ?></li>
<?php endif; ?>
<?php if(get_post_meta($post->ID, 'phone', true)): ?>
<li><span class="glyphicon glyphicon-phone-alt" data-toggle="tooltip" data-placement="right" title="Phone"></span> <?php echo get_post_meta($post->ID, 'phone', true); ?></li>
<?php endif; ?>
<?php if(get_post_meta($post->ID, 'email', true)): ?>
<li><i class="fa fa-envelope" data-toggle="tooltip" data-placement="right" title="Email"></i><a href="mailto:<?php echo get_post_meta($post->ID, 'email', true); ?>"> <span class="ellipsis"> <?php echo get_post_meta($post->ID, 'email', true); ?></span></a></li>
<?php endif; ?>
</ul>
<?php endif; ?>
</div><!-- caption -->
</div><!-- thumbnail -->
</div><!-- col-xs-6 col-md-4 col-lg-3 -->
<?php if ($i % 4 == 0) : //adds a clearfix every 3 items. ?>
<div class="clearfix visible-lg-block"></div>
<?php endif; ?>
<?php if ($i % 3 == 0) : //adds a clearfix every 2 items. ?>
<div class="clearfix visible-md-block"></div>
<?php endif; ?>
<?php if ($i % 2 == 0) : //adds a clearfix every 3 items. ?>
<div class="clearfix visible-sm-block visible-xs-block"></div>
<?php endif; ?>
<?php endwhile; else: ?>
<?php wpbeginner_numeric_posts_nav(); ?>
<?php wp_reset_query(); // Restore global post data stomped by the_post(). ?>
<p><?php _e('Sorry, no posts matched your criteria.'); ?></p><?php endif; ?>
</div><!-- directory row -->
</div><!-- col-sm-9 -->
</div><!-- row -->
</div><!-- container -->
</div><!-- background-color-gray -->
</div><!-- main -->
<?php get_footer(); ?>