-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathsingle-campus.php
More file actions
60 lines (54 loc) · 1.87 KB
/
single-campus.php
File metadata and controls
60 lines (54 loc) · 1.87 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
<?php
get_header();
while( have_posts() ) {
the_post();
pageBanner();
?>
<div class="container container--narrow page-section">
<div class="metabox metabox--position-up metabox--with-home-link">
<p><a class="metabox__blog-home-link" href="<?php echo get_post_type_archive_link('campus'); ?>"><i class="fa fa-home" aria-hidden="true"></i>All Campuses</a> <span class="metabox__main"><?php the_title(); ?></span></p>
</div>
<div class="generic-content"><?php the_content(); ?></div>
<div class="acf-map">
<?php $mapLocation = get_field('map_location'); ?>
<div class="marker" data-lat="<?php echo $mapLocation['lat'] ?>" data-lng="<?php
echo $mapLocation['lng']; ?>">
<h3><?php echo the_title(); ?></h3>
<?php echo $mapLocation['address']; ?>
</div>
</div>
<?php
// Professors
$relatedPrograms = new WP_Query( array(
'posts_per_page' => -1,
'post_type' => 'program',
'orderby' => 'title',
'order' => 'ASC',
'meta_query' => array( // note: array-array is required even on single filters
array(
'key' => 'related_campus',
'compare' => 'LIKE',
'value' => '"' . get_the_id() . '"'
)
)
));
if ( $relatedPrograms->have_posts() ) {
echo '<hr class="section-break">';
echo '<h2 class="headline headline--medium">Programs Available At This Campus</h2>';
echo '<ul class="min-list link-list">';
while( $relatedPrograms->have_posts() ) {
$relatedPrograms->the_post(); ?>
<li>
<a href="<?php the_permalink(); ?>"><?php the_title(); ?></a>
</li>
<?php
}
echo '</ul>';
}
wp_reset_postdata();
?>
</div>
<?php
}
get_footer();
?>