-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsingle-team_member.php
More file actions
150 lines (115 loc) · 6.67 KB
/
single-team_member.php
File metadata and controls
150 lines (115 loc) · 6.67 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
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
<?php
/**
* Single Team Member template
*/
if ( has_term( 'board', 'team_role' ) ) {
wp_redirect( site_url('team/') );
}
global $post;
get_header();
$roles = get_the_terms( $post->ID, 'team_role' );
$member_role = ( $roles ) ? $roles[0]->name : 'Team';
$member_title = get_field( 'member_title' );
$member_scope_areas = get_the_terms( $post->ID, 'service' );
$member_issue_areas = get_the_terms( $post->ID, 'issue' );
$member_website = get_field( 'member_website' ); ?>
<div class="site-content">
<?php while ( have_posts() ) : the_post(); ?>
<article <?php post_class('wrap'); ?>>
<section class="section">
<div class="flex has-sidebar u-container">
<?php get_template_part( 'partials/menu-ui' ); ?>
<div class="sidebar-masthead section__sidebar flex__item">
<?php get_template_part( 'partials/masthead' ); ?>
</div>
<div class="section__content flex__item">
<div class="page-header">
<a href="<?php echo site_url( 'team/' ); ?>" class="member-heading h2 u-display-block u-mt-pull" data-title="<?php echo $member_role; ?>" data-title-hover="← Team" role="presentation"> </a>
</div>
</div>
</div><!-- .u-container -->
</section>
<section class="section">
<div class="flex u-container">
<div class="section__content flex__item u-pt-2">
<div class="flex">
<div class="flex__item is-flush u-width-5">
<?php if ( get_the_post_thumbnail() ) : ?>
<?php the_post_thumbnail( 'large', array( 'class' => 'u-mb-3' ) ); ?>
<?php endif; ?>
<?php if ( $member_scope_areas ) : ?>
<div class="scope-areas member-meta u-mb-3">
<h6 class="u-mt-0">Scope Focus Areas</h6>
<div class="u-mt-nudge">
<?php foreach( $member_scope_areas as $scope ) : ?>
<p class="u-mt-0"><?php echo $scope->name; ?></p>
<?php endforeach; ?>
</div>
</div>
<?php endif; ?>
<?php if ( $member_issue_areas ) : ?>
<div class="issue-areas member-meta u-mb-3">
<h6 class="u-mt-0">Issue Focus Areas</h6>
<div class="u-mt-nudge">
<?php foreach( $member_issue_areas as $issue ) : ?>
<p class="u-mt-0"><?php echo $issue->name; ?></p>
<?php endforeach; ?>
</div>
</div>
<?php endif; ?>
<?php if ( $member_website ) : ?>
<div class="member-website member-meta">
<a href="<?php echo esc_url( $member_website ); ?>" class="h6" target="_blank" rel="nofollow" >View Website ↗</a>
</div>
<?php endif; ?>
</div>
<div class="flex__item u-width-7">
<h1 class="post-title u-mt-pull">
<?php the_title(); ?>
</h1>
<div class="h6"><?php echo $member_title; ?></div>
<?php if ( $post->post_excerpt ) : ?>
<div class="h6"><?php echo get_the_excerpt(); ?></div>
<?php endif; ?>
<div class="post-content">
<?php the_content(); ?>
</div>
</div>
</div>
</div>
</div><!-- .u-container -->
</section>
<!--Related Posts-->
<?php
$args = array(
'post_type' => 'project',
'posts_per_page' => 10,
'meta_query' => array(
array(
'key' => 'project_team_members',
'value' => strval($post->ID),
'compare' => 'LIKE'
)
)
);
$projects = new WP_Query( $args ); ?>
<?php if ( $projects->have_posts() ) : ?>
<section class="section">
<div class="flex u-container">
<div class="section__content flex__item u-width-12 u-pt-6">
<div class="h6 u-mt-0"><?php echo explode( ' ', get_the_title() )[0] . '\'s Projects'?></div>
<ul class="u-clearfix u-mt-0">
<?php while( $projects->have_posts() ) : $projects->the_post(); ?>
<li class="u-span-6 u-mt-1">
<?php get_template_part( 'partials/content-preview', 'project' ); ?>
</li>
<?php endwhile; ?>
</ul>
</div>
</div><!-- .u-container -->
</section>
<?php endif; ?>
</article>
<?php endwhile; ?>
</div>
<?php get_footer(); ?>