-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathsingle-seminars.php
80 lines (67 loc) · 2.57 KB
/
single-seminars.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
<?php
/**
* The template for displaying all single posts
*
* @link https://developer.wordpress.org/themes/basics/template-hierarchy/#single-post
*
* @package applied-computer-science
*/
get_header();
?>
<div id="primary" class="content-area">
<main id="main" class="site-main">
<?php
while ( have_posts() ) :
the_post();
$fields = get_fields();
$date_end = '';
$n_dates = count($fields['date']);
if ($n_dates > 1 && @$fields['date'][$n_dates - 1]['data']) {
$date_end = date_i18n(pll__('j F Y'), DateTime::createFromFormat('Ymd', $fields['date'][$n_dates - 1]['data'])->getTimestamp());
}
$date = date_i18n(pll__('j F Y'), DateTime::createFromFormat('Ymd', $fields['date'][0]['data'])->getTimestamp()) . (@$date_end ? ' - ' . $date_end : '');
get_template_part( 'template-parts/content', get_post_type() );
?>
<div class="container">
<?php if ($fields['relatore']) : ?>
<h3><?php _e("Relatore", "applied-computer-science"); ?></h3>
<p><?php echo $fields['relatore'] ?></p>
<?php endif; ?>
<?php if ($fields['docente']) : ?>
<h3><?php _e("Docente di riferimento", "applied-computer-science"); ?></h3>
<p><?php echo $fields['docente'] ?></p>
<?php endif; ?>
<?php if ($fields['vincoli']) : ?>
<h3><?php _e("Vincoli di partecipazione", "applied-computer-science"); ?></h3>
<p><?php echo $fields['vincoli'] ?></p>
<?php endif; ?>
<?php if (count($fields['date']) > 0) : ?>
<h3><?php _e("Date", "applied-computer-science"); ?></h3>
<table class="big">
<thead class="dark">
<tr>
<th><?php _e("Luogo", "applied-computer-science"); ?></th>
<th><?php _e("Data", "applied-computer-science"); ?></th>
<th><?php _e("Orario", "applied-computer-science"); ?></th>
<th><?php _e("Crediti (CFU)", "applied-computer-science"); ?></th>
</tr>
</thead>
<tbody>
<?php foreach ($fields['date'] as $date) : ?>
<?php if (!($date['data'] && $date['orario'])) continue ?>
<tr>
<td><?php echo $date['luogo'] ?></td>
<td><?php echo date_i18n(pll__('j F Y'), DateTime::createFromFormat('Ymd', $date['data'])->getTimestamp()) ?></td>
<td><?php echo $date['orario'] ?></td>
<td><?php echo $date['crediti'] ?></td>
</tr>
<?php endforeach; ?>
</tbody>
</table>
<?php endif; ?>
</div>
<?php endwhile; // End of the loop. ?>
</main><!-- #main -->
</div><!-- #primary -->
<?php
get_footer();