-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathsingle-facilitators.php
81 lines (72 loc) · 2.62 KB
/
single-facilitators.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
<?php
/**
* The template for displaying all single posts
*
* @link https://developer.wordpress.org/themes/basics/template-hierarchy/#single-post
*
* @package understrap
*/
get_header();
$container = get_theme_mod( 'understrap_container_type' );?>
<?php while ( have_posts() ) : the_post(); ?>
<div class="<?php echo esc_attr( $container ); ?> ">
<h3 class="brownline-before mb-4 d-none d-md-block">Facilitator</h3>
<div class="row">
<figure class="col-md-3 col-12 offset-md-1">
<?php the_post_thumbnail( 'medium', ['class' => 'img-responsive, w-100']); ?>
</figure>
<div class="col-md-8 col-12 my-md-0 my-2">
<article>
<h2><?php the_title(); ?></h2>
<?php $units = get_field('unit_name');
if($units):
foreach($units as $unit){?>
<div class="media mb-3">
<div class="media-body">
<small class="text-muted">
<?php echo $unit->post_title; ?>
</small>
</div>
</div>
<?php }
endif;
?>
<p class="text-md-left text-justify">
<?php echo get_the_content(); ?>
</p>
</article>
</div>
</div>
<h3 class="brownline-before my-4">Related Workshops</h3>
<div class="row">
<div class="col-md-8 col-12 offset-md-4">
<div class="card-deck scrollable-content">
<?php
$currentFacilitatorId = get_the_ID();
$workshops = agpf_workshop_query(); //this function resturns the variable $workshops
if($workshops):
foreach($workshops as $post){
$postId = $post->post_id;
$facilitatorPostObject = get_field('facilitators', $postId);
if($facilitatorPostObject):
foreach($facilitatorPostObject as $facilitator){
$facilitatorId = $facilitator->ID;
if($facilitatorId == $currentFacilitatorId):
agpf_related_loop($post);
endif;
}
endif;
}
?>
</div>
</div>
<?php else:
echo "No Workshops Found";
endif;
?>
</div>
</div>
<?php
endwhile; ?>
<?php
get_footer(); ?>