forked from UCF/TBHC-Theme
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsingle-person.php
70 lines (68 loc) · 2.81 KB
/
single-person.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
<?php disallow_direct_load('single-person.php');?>
<?php get_header(); the_post();?>
<div class="row page-content person-profile" id="<?=$post->post_name?>">
<div class="col-md-15 col-sm-15">
<div id="page-title">
<div class="row">
<div class="col-md-12 col-sm-12">
<h1><?php the_title(); ?></h1>
</div>
<?php esi_include( 'output_weather_data', 'col-md-3 col-sm-3' ); ?>
</div>
</div>
</div>
<div class="col-md-3 col-sm-3 details">
<?
global $wp;
$current_url = add_query_arg( $wp->query_string, '', home_url( $wp->request ) );
$title = get_post_meta($post->ID, 'person_jobtitle', True);
$time = get_post_meta($post->ID, 'dist_speaker_time', True);
$date = get_post_meta($post->ID, 'dist_speaker_date', True);
$location = get_post_meta($post->ID, 'dist_speaker_location', True);
$image_url = get_featured_image_url($post->ID, 'person-grid-image');
$email = get_post_meta($post->ID, 'person_email', True);
$phones = Person::get_phones($post);
$office = get_post_meta($post->ID, 'person_office', True);
?>
<img src="<?=$image_url ? $image_url : get_bloginfo('stylesheet_directory').'/static/img/no-photo.jpg'?>" />
</div>
<div class="col-md-12 col-sm-12">
<article role="main">
<h2><?=$post->post_title?><?=($title == '') ?: ' - '.$title ?></h2>
<div class="contact">
<?if(strpos(wp_get_referer(), "distinguished-speaker") === false){ //and type = staff?>
<ul class="list-unstyled">
<?
if(count($phones)) {
foreach($phones as $phone) { ?>
<li><i class="glyphicon glyphicon-earphone"></i><a href="tel:<?=$phone?>" class="phones"><?=$phone?></a></li>
<? }
} ?>
<? if($email != '') { ?>
<li><i class="glyphicon glyphicon-envelope"></i><a class="email" href="mailto:<?=$email?>"><?=$email?></a></li>
<? } ?>
<? if($office != '') { ?>
<li><i class="glyphicon glyphicon-map-marker"></i><span class="office"><?=$office?></span></li>
<? } ?>
</ul>
<? }
if(strpos(wp_get_referer(), "distinguished-speaker") > 0){ //or type = dist speaker ?>
<ul class="list-unstyled">
<? if($time != '') { ?>
<li><i class="glyphicon glyphicon-time"></i><span class="time"><?=$time?></span></li>
<? } ?>
<? if($date != '') { ?>
<li><i class="glyphicon glyphicon-calendar"></i><span class="date"><?=date('F jS, Y', strtotime($date))?></span></li>
<? } ?>
<? if($location != '') { ?>
<li><i class="glyphicon glyphicon-map-marker"><!--glyphicon-globe"> replaced with a gps marker --></i><span class="location"><?=$location?></span></li>
<? } ?>
</ul>
<? } ?>
</div>
<?=$content = str_replace(']]>', ']]>', apply_filters('the_content', $post->post_content))?>
</article>
</div>
</div>
</div>
<?php get_footer();?>