forked from thephuse/hackathon-wordpress-theme
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtemplate-organizers.php
More file actions
111 lines (100 loc) · 3.14 KB
/
Copy pathtemplate-organizers.php
File metadata and controls
111 lines (100 loc) · 3.14 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
110
111
<?php
/*
Template Name: Organizers
*/
get_header();
?>
<article class="organizers container">
<?php if ( have_posts() ) : ?>
<?php while ( have_posts() ) : the_post();
$section1_header = get_field('section1_header');
$section1_people = get_field('section1_people');
$section2_header = get_field('section2_header');
$section2_people = get_field('section2_people');
$section3_header = get_field('section3_header');
if(!empty($section1_people)) {
if(!empty($section1_header)) {
echo '<h2>' . $section1_header . '</h2>';
}
echo '<ul class="avatars avatars-large">';
foreach($section1_people as $item) {
// name is required
// image is an object
$image = $item['image'];
$name = $item['name'];
$company = $item['company'];
$email = $item['email'];
echo '<li>';
echo empty($email) ? '<a href="#" class="trigger-info">' : '<a href="mailto:'.$email.'">';
if(!empty($image)) {
$src = $image['sizes']['large-avatar'];
echo '<img src="' . $src . '" alt="' . $name . '" />';
}
echo '<div class="info-wrap"><div class="info">';
echo '<strong>' . $name . '</strong>';
if (!empty($company)) {
echo ' ' . $company;
}
echo '</div></div></a></li>';
}
echo '</ul>';
}
if(!empty($section2_people)) {
if(!empty($section2_header)) {
echo '<h2>' . $section2_header . '</h2>';
}
echo '<ul class="avatars avatars-medium">';
foreach($section2_people as $item) {
// name is required
// image is an object
$image = $item['image'];
$name = $item['name'];
$company = $item['company'];
$email = $item['email'];
echo '<li>';
echo empty($email) ? '<a href="#" class="trigger-info">' : '<a href="mailto:'.$email.'">';
if(!empty($image)) {
$src = $image['sizes']['thumbnail'];
echo '<img src="' . $src . '" alt="' . $name . '" />';
}
echo '<div class="info-wrap"><div class="info">';
echo '<strong>' . $name . '</strong>';
if (!empty($company)) {
echo ' ' . $company;
}
echo '</div></div></a></li>';
}
echo '</ul>';
}
if(!empty($section3_header)) {
echo '<h2>' . $section3_header . '</h2>';
}
endwhile;
endif;
$people = getUserList();
if($people) {
echo '<ul class="avatars avatars-small">';
foreach($people as $person) {
$aid = $person->ID;
$info = get_userdata($aid);
$name = get_the_author_meta('display_name', $aid);
$location = get_the_author_meta('location', $aid);
$avatar = get_avatar($aid, 48);
$roles = implode(' ', $info->roles);
if (preg_match('/Organizer/i', $roles)) {
echo '<li><a href="#" data-tooltip="';
echo '<strong>' . $name . '</strong>';
if ($location != 'x') {
// uses locations from php/locations.php
echo ' ' . $locations[$location];
}
echo '">';
echo $avatar;
echo '</a></li>';
}
}
echo '</ul>';
}
?>
</article>
<?php get_footer(); ?>