-
Notifications
You must be signed in to change notification settings - Fork 0
/
single-people.php
105 lines (102 loc) · 3.33 KB
/
single-people.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
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
/*
Template Name: Person Detail
*/
?>
<?php get_header(); ?>
<div id="content" class="clearfix container1160 peopleContainer">
<div id="main" role="main">
<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
<article id="post-<?php the_ID(); ?>" <?php post_class('clearfix'); ?> role="article">
<header>
<div class="page-header">
<div class="container container620">
<div class="row">
<div class="col-sm-12">
<h1>Author</h1>
</div>
</div>
</div>
</div>
</header>
<section class="clearfix mb_80">
<div class="container container620">
<div class="row">
<?php
// Display all people when acf roles is not set
// $roles = get_field('roles');
// if (!empty($roles)){
// $terms = get_field('roles')->name;
// } else {
// $terms = array_map(function($term){ return $term->slug; }, get_terms('role'));
// }
$terms = get_field('roles')->name;
$args = array(
'post_type' => 'people',
'tax_query' => array(
array(
'taxonomy' => 'role',
'field' => 'slug',
'terms' => 'author',
)
)
);
$query = new WP_Query( $args );
while ($query->have_posts() ) :
$query->the_post();
?>
<div class="col-sm-12 mt_50">
<div class="bg_image mb_30">
<?php the_post_thumbnail( 'people-thumb-md' ); ?>
</div>
<h3 class="mt_30 mb_30 text_indent">
<?php the_title(); ?>
</h3>
<div class="text_big clearfix">
<?php the_content(); ?>
</div>
<div class="row mt_15" style="overflow:hidden;">
<?php if(get_field('social_link_1')) : ?>
<div class="col-sm-12 text_indent">
<a href="<?php echo get_field('social_link_1')?>" class="more_info" target="_blank"><?php echo get_field('social_label_1'); ?></a>
</div>
<?php endif; ?>
<?php if(get_field('social_link_2')) : ?>
<div class="col-sm-12 text_indent">
<a href="<?php echo get_field('social_link_2')?>" class="more_info" target="_blank"><?php echo get_field('social_label_2'); ?></a>
</div>
<?php endif; ?>
<?php if(get_field('social_link_3')) : ?>
<div class="col-sm-12 text_indent">
<a href="<?php echo get_field('social_link_3')?>" class="more_info" target="_blank"><?php echo get_field('social_label_3'); ?></a>
</div>
<?php endif; ?>
</div>
</div>
<?php
endwhile;
wp_reset_postdata();
?>
</div>
</div>
</section>
<footer>
<p class="clearfix"><?php the_tags('<span class="tags">' . __("Tags","wpbootstrap") . ': ', ', ', '</span>'); ?></p>
</footer>
</article>
<?php endwhile; ?>
<?php else : ?>
<article id="post-not-found">
<header>
<h1><?php _e("Not Found", "wpbootstrap"); ?></h1>
</header>
<section class="post_content">
<p><?php _e("Sorry, but the requested resource was not found on this site.", "wpbootstrap"); ?></p>
</section>
<footer>
</footer>
</article>
<?php endif; ?>
</div>
</div>
<?php get_footer(); ?>