forked from yuannancheng/fictional-university
-
Notifications
You must be signed in to change notification settings - Fork 0
/
single-event.php
52 lines (49 loc) · 1.28 KB
/
single-event.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
<?php
get_header();
// 将当前文章设置为全局变量
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('event'); ?>"
>
<i class="fa fa-home" aria-hidden="true"></i>
所有活动
</a>
<span class="metabox__main"><?php the_title(); ?></span>
</p>
</div>
<div class="generic-content">
<?php the_content(); ?>
</div>
<?php
$relatedPrograms = get_field('related_programs');
if ($relatedPrograms) {
// 如果活动绑定了相关学科,则显示相关学科的列表
?>
<hr class="section-break">
<h2 class="headline headline--medium">相关学科</h2>
<ul class="link-list min-list">
<?php
foreach ($relatedPrograms as $program) {
?>
<li>
<a href="<?php echo get_the_permalink($program->ID); ?>">
<?php echo $program->post_title; ?>
</a>
</li>
<?php
}
?>
</ul>
<?php
}
?>
</div>
<?php
get_footer();
?>