forked from AgriLife/AgriFlex
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patharchive-staff.php
More file actions
105 lines (84 loc) · 3.5 KB
/
archive-staff.php
File metadata and controls
105 lines (84 loc) · 3.5 KB
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
<?php
/**
* The Template for displaying all staff single posts or pulling in staff web service for counties.
*
* @package AgriFlex
* @since AgriFlex 1.0
*/
?>
<?php get_header(); ?>
<div id="wrap">
<div id="content" role="main">
<?php
agriflex_before_loop();
$a = agriflex_agency();
if ( ( $a['ext-type'] == 'county' || $a['ext-type'] == 'tce' ) && $a['single'] ) :
// For County Extension Offices
// This pulls from a managed staff database web service
if ( have_posts() ) while ( have_posts() ) : the_post();
county_office_info(); ?>
<div id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
<h1 class="entry-title"><?php the_title(); ?></h1>
<div class="entry-content">
<?php the_content(); ?>
</div><!-- .entry-content -->
<?php show_county_directory($options); ?>
</div><!-- #post-## -->
<?php endwhile; // end of the loop. ?>
<?php else:
// Everyone else gets info from 'Staff' custom post type ?>
<?php agriflex_archive_title(); ?>
<div class="staff-search-form">
<label>
<h4>Search Staff Database</h4>
</label>
<form role="search" class="searchform" method="get" id="searchform" action="<?php echo home_url( '/' ); ?>">
<input type="text" class="s" name="s" id="s" placeholder="Wilber B. Snodgrass" onfocus="if(this.value==this.defaultValue)this.value='';" onblur="if(this.value=='')this.value=this.defaultValue;"/><br />
<input type="hidden" name="post_type" value="staff" />
</form>
</div><!-- .staff-search-form -->
<ul class="staff-listing-ul">
<?php
$args = array(
'post_type' => 'staff',
'posts_per_page' => -1,
'orderby' => 'title',
'order' => 'ASC'
);
$my_query = new WP_Query($args);
// The Loop
while ($my_query->have_posts()) : $my_query->the_post();
$my_meta = get_post_meta($post->ID,'_my_meta',TRUE);
?>
<li class="staff-listing-item">
<div class="role staff-container">
<a href="<?php the_permalink(); ?>" rel="bookmark">
<?php if ( has_post_thumbnail() ) {
the_post_thumbnail('staff_archive');
} else {
echo '<img src="' . get_template_directory_uri() .'/images/AgriLife-default-staff-image.png?v=100" alt="AgriLife Logo" title="AgriLife" />';
} ?>
</a>
<hgroup class="staff-head">
<h2 class="staff-title" title="<?php the_title(); ?>">
<a href="<?php the_permalink(); ?>"><?php echo $my_meta['firstname'] . ' ' . $my_meta['lastname']; ?></a>
</h2>
<h3 class="staff-position"><?php echo $my_meta['position']; ?></h3>
</hgroup>
<div class="staff-contact-details">
<p class="staff-phone tel"><?php echo $my_meta['phone']; ?></p>
<p class="staff-email email"><a href="mailto:<?php echo $my_meta['email']; ?>"><?php echo $my_meta['email']; ?></a></p>
</div><!-- .staff-contact-details -->
</div><!-- .role .staff-container -->
</a>
</li>
<?php endwhile; ?>
</ul>
<?php agriflex_content_nav( 'nav-below' ); ?>
<?php agriflex_after_loop(); ?>
<?php wp_reset_query(); ?>
<?php endif;?>
</div><!-- #content -->
</div><!-- #wrap -->
<?php get_sidebar(); ?>
<?php get_footer(); ?>