-
Notifications
You must be signed in to change notification settings - Fork 0
/
content-akce.php
87 lines (75 loc) · 2.33 KB
/
content-akce.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
81
82
83
84
85
86
87
<?php
/**
* Výpis jednoho excerptu akce s kalendářem (akce)
*
* @package Persona Studio
* @subpackage Instuktoři
*/
$akce_from_timestamp = get_post_meta( $post->ID, 'akce_from', true );
$akce_to_timestamp = get_post_meta( $post->ID, 'akce_to', true );
$akce_url = get_post_meta( $post->ID, 'akce_url', true );
$akce_from_time = get_post_meta( $post->ID, 'akce_from_time', true );
$akce_place = get_post_meta( $post->ID, 'akce_place', true );
$akce_map = get_post_meta( $post->ID, 'akce_map', true );
echo '<div class="row">';
echo '<div class="col-sm-9">';
the_title( '<h1>', '</h1>' );
the_content();
if ( ! empty( $akce_url ) ) {
echo '<a href="' . $akce_url . '" class="akce-more">Více informací naleznete na webu akce ></a>';
}
echo '</div>'; // .col-sm-9
echo '<div class="col-sm-3">';
?>
<div class="akce-meta-box">
<?php the_title( '<h3>', '</h3>' ); ?>
<?php
$terms = get_the_terms( $post->ID, 'typ_akce' );
$count = count( $terms );
if ( $count > 0 && is_array( $terms ) ) {
$i = 1;
foreach ( $terms as $term ) {
if ( $i > 1 ) {
$category_list .= ', ';
}
$category_list .= $term->name;
$i++;
}
}
echo '<strong>Typ akce: </strong>' . $category_list . '<br/><br/>';
$category_list = '';
?>
<?php echo '<strong>Začátek:</strong> ' . date( 'd.m.Y', $akce_from_timestamp + 0 ); ?>
<?php
if ( ! empty( $akce_from_time ) ) {
echo 'od ' . $akce_from_time;
}
?>
<br/>
<?php
if ( ! empty( $akce_to_timestamp ) ) {
echo '<strong>Konec:</strong> ' . date( 'd.m.Y', $akce_to_timestamp ) . '<br/>';
}
?>
<br/>
<?php
if ( ! empty( $akce_place ) or ! empty( $akce_map ) ) {
echo '<strong>Místo konání: </strong><br/>';
if ( ! empty( $akce_place ) ) {
echo $akce_place . '<br/>';
}
if ( ! empty( $akce_map ) ) {
echo '<iframe
width="243"
height="126"
frameborder="0" style="border:0"
src="https://www.google.com/maps/embed/v1/place?key=' . get_theme_mod('google_maps_api_key') . '&q=' . $akce_map . '&zoom=15" allowfullscreen>
</iframe>';
}
}
?>
</div>
<?php
echo '</div>'; // .col-sm-3
echo '</div>'; // .row
?>