-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsingle-ctc_person.php
More file actions
109 lines (94 loc) · 3.12 KB
/
single-ctc_person.php
File metadata and controls
109 lines (94 loc) · 3.12 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
106
107
108
109
<?php
/*
Individual Person template.
Based on the Church Theme Framework and custom post type.
If you need to see all potential data, use something like print_r(ctfw_person_data());
*/
?>
<?php get_header(); ?>
<?php
//print_r(ctfw_person_data());
$person_fname = wp_trim_words( get_the_title(), 1, '' );
$person_position = ctfw_person_data()['position'];
$person_phone = ctfw_person_data()['phone'];
$person_email = ctfw_person_data()['email'];
$person_urls = ctfw_person_data()['urls'];
$banner_img_src = get_header_image();
?>
<div id="banner">
<span class="overlay"></span>
<?php echo '<img class="banner-bg" src="'.$banner_img_src.'" alt="">'; ?>
<div class="banner-text">
<?php
if ( has_post_thumbnail() ) {
echo '<span class="img-thumbnail person-thumb">';
the_post_thumbnail('full');
echo '</span>';
}
?>
<h1 class="page-title"><?php the_title(); ?></h1>
<?php
if($person_position != "") {
echo "<p class='page-byline'>$person_position</p>";
}
?>
</div><!-- .banner-text -->
</div><!-- #banner -->
<div id="content">
<div id="inner-content" class="container">
<div class="row">
<div id="sidebar" class="sidebar person col-lg-3 col-md-4" role="complementary">
<?php if( $person_phone || $person_email || $person_urls ) { ?>
<h3>Connect</h3>
<?php } ?>
<p>
<?php if($person_email) { ?>
<i class="fa fa-envelope" aria-hidden="true"></i> <?php echo ctfw_email($person_email); ?>
<br>
<?php } ?>
<?php if($person_phone) { ?>
<i class="fa fa-phone" aria-hidden="true"></i> <a href="tel:<?php echo $person_phone; ?>"><?php echo $person_phone; ?></a>
<br>
<?php }
if($person_urls) {
$urls = wp_extract_urls( $person_urls );
echo '<span class="person-profiles">';
foreach ($urls as $url) {
$url = esc_url($url);
if(strpos($url, 'facebook.com') !== false){
$fa_icon_class = 'fab fa-facebook';
}
elseif(strpos($url, 'twitter.com') !== false){
$fa_icon_class = 'fab fa-twitter';
}
elseif(strpos($url, 'instagram.com') !== false){
$fa_icon_class = 'fab fa-instagram';
}
elseif(strpos($url, 'snapchat.com') !== false){
$fa_icon_class = 'fab fa-snapchat-ghost';
}
elseif(strpos($url, 'linkedin.com') !== false){
$fa_icon_class = 'fab fa-linkedin';
}
else {
$fa_icon_class = 'fas fa-link';
}
echo '<a href="'.$url.'" target="_blank">';
echo '<i class="'.$fa_icon_class.'" aria-hidden="true"></i>';
echo '</a>';
}//end foreach
echo '</span><!-- .person-profiles-->';
}//endif ?>
</p>
</div>
<main id="main" class="col-lg-9 col-md-8" role="main">
<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
<?php get_template_part( 'parts/loop', 'person' ); ?>
<?php endwhile; else : ?>
<?php get_template_part( 'parts/content', 'missing' ); ?>
<?php endif; ?>
</main> <!-- end #main -->
</div>
</div> <!-- end #inner-content -->
</div> <!-- end #content -->
<?php get_footer(); ?>