-
Notifications
You must be signed in to change notification settings - Fork 0
/
template-livestream.php
40 lines (33 loc) · 1.54 KB
/
template-livestream.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
<?php
// Template Name: WPCampus 2017: Livestream
// Add livestream URLs to the page
function wpc_2017_add_livestream_template( $content ) {
ob_start();
// Add the template
?>
<script id="wpcampus-livestream-template" type="text/x-handlebars-template">
<div id="wpc-ls-event-{{id}}" class="wpc-ls{{#event_types}} {{.}}{{/event_types}}">
<h3 class="event-title"><strong>{{{title.rendered}}}</strong></h3>
{{#session_livestream_url}}
<div class="callout wpc-ls-callout"><a href="{{session_livestream_url}}" target="_blank">Watch the livestream</a></div>
{{/session_livestream_url}}
{{^session_livestream_url}}
<div class="callout wpc-ls-callout"><em><strong>This event does not have a livestream.</strong></em></div>
{{/session_livestream_url}}
{{#if event_speakers}}<div class="event-speakers">{{#each event_speakers}}{{#unless @first}}, {{/unless}}<span class="event-speaker">{{post_title}}</span>{{/each}}</div>{{/if}}
<div class="event-dt">{{event_time_display}}</div>
<a href="{{link}}">Session details</a>
{{#if session_categories}}<div class="event-categories">{{#each session_categories}}{{#unless @first}}, {{/unless}}{{.}}{{/each}}</div>{{/if}}
{{#event_links}}{{body}}{{/event_links}}
<?php /*<iframe src="{{session_livestream_url}}" style="width:100%;height:600px;"></iframe>*/ ?>
</div>
</script>
<?php
// Add the schedule holder
?>
<div id="wpcampus-livestream"></div>
<?php
return $content . ob_get_clean();
}
add_filter( 'the_content', 'wpc_2017_add_livestream_template' );
get_template_part( 'index' );