-
Notifications
You must be signed in to change notification settings - Fork 0
/
single-event.php
71 lines (65 loc) · 2.61 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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
<?php
/**
* Single post template for events
*
* @package KCSU
* @file single_events.php
* @author Gideon Farrell <[email protected]>
* @license BSD 3-Clause
*/
get_header();
while(have_posts()): the_post();
?>
<div class="container events post">
<header>
<h1><?php the_title(); ?></h1>
</header>
<hr/>
<div class="row">
<div class="span8">
<article>
<?php the_content(); ?>
</article>
</div>
<div class="span4">
<section class="events extra">
<ul class="where-and-when">
<li class="date"><i class="icon-calendar"></i><?php
echo DateTime::createFromFormat('Ymd', get_field('date'))->format('l, jS F Y'); ?></li>
<li class="time"><i class="icon-time"></i><?php echo get_field('time'); ?></li>
<li class="location"><i class="icon-map-marker"></i><?php echo get_field('location'); ?></li>
</ul>
</section>
<section class="roll events">
<h2>Coming up</h2>
<ul class="posts-list events">
<?php
$events = kcsu_get_upcoming_events(date('Ymd', strtotime('+1 month')));
foreach ($events as $event)
{
echo string_format(
'<li><!-- {id} --><a href="{link}" title="{title}">{title}</a> <span class="aux date">{date}</span><span class="aux"> - </span><span class="aux location">{location}</span></li>',
$event
);
}
?>
</ul>
</section>
<section class="roll events">
<h2>Outside King’s</h2>
<ul class="posts-list events">
<?php
$events = kcsu_get_upcoming_events(date('Ymd', strtotime('+1 month')), 1);
foreach ($events as $event)
{
echo string_format(
'<li><!-- {id} --><a href="{link}" title="{title}">{title}</a> <span class="aux date">{date}</span><span class="aux"> - </span><span class="aux location">{location}</span></li>',
$event
);
}
?>
</ul>
</section>
</div>
</div>
<?php endwhile; get_footer(); ?>