-
Notifications
You must be signed in to change notification settings - Fork 1
/
search-faculty.php
90 lines (70 loc) · 2.32 KB
/
search-faculty.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
<section id="primary" class="content-area wrap group" role="main">
<div class="quarter left-menu">
<div class="menu-primary">
<h5 class="menu-title">Academics</h5>
<?php wp_nav_menu( array( 'theme_location' => 'academics-primary', 'menu_class' => 'nav-menu' ) ); ?>
</div>
<div class="menu-buttons"><?php wp_nav_menu( array( 'theme_location' => 'academics-buttons', 'menu_class' => 'nav-menu' ) ); ?></div>
</div>
<div class="three-quarter">
<h1 class="page-title">Faculty Directory Search: <span>'<?php print $_REQUEST["s"]; ?>'</span></h1>
<?php include( "searchform-faculty.php" ); ?>
<?php
global $wp_query;
$wp_query->query_vars["posts_per_page"] = 20;
$wp_query->query_vars["post_type"] = 'faculty';
$wp_query->query_vars["orderby"] = 'title';
$wp_query->query_vars["order"] = 'ASC';
if ( isset( $_REQUEST['s'] ) ) {
$wp_query->query_vars['s'] = $_REQUEST['s'];
$wp_query->query_vars["meta_query"] = array(
'relation' => 'OR',
array(
'key' => CMB_PREFIX . 'faculty_fname',
'value' => $query->query_vars['s'],
'compare' => 'LIKE',
),
array(
'key' => CMB_PREFIX . 'faculty_lname',
'value' => $query->query_vars['s'],
'compare' => 'LIKE',
),
array(
'key' => CMB_PREFIX . 'faculty_areas',
'value' => $query->query_vars['s'],
'compare' => 'LIKE',
),
);
}
$wp_query->get_posts();
if ( $wp_query->have_posts() ) : ?>
<div class="faculty-directory">
<?php
// Start the Loop.
while ( $wp_query->have_posts() ) : $wp_query->the_post();
?>
<div class="faculty-entry">
<?php the_post_thumbnail(); ?>
<div class="info">
<a href="<?php the_permalink(); ?>" class="btn">View Profile »</a>
<h4><a href="<?php the_permalink() ?>"><?php the_title(); ?></a></h4>
<p class="faculty-title"><?php print get_cmb_value( "faculty_title" ); ?></p>
<a href="mailto:<?php print get_cmb_value( "faculty_email" ); ?>"><?php print get_cmb_value( "faculty_email" ); ?></a>
</div>
</div>
<?php
endwhile;
?>
<div class="pagination">
<?php print paginate_links(); ?>
</div>
<?php
else :
?>
<p>No results for that search term.</p>
<?php
endif;
?>
</div>
</div>
</section><!-- #primary -->