This repository has been archived by the owner on Jan 13, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
/
single.php
337 lines (321 loc) · 16 KB
/
single.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
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
<?php /* Single-Template */ ?>
<?php is_rest() ? : get_header(); ?>
<?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
<div class="container mod-single">
<div class="mod-content">
<?php
if ( have_rows( 'content_elemente' ) ):
while ( have_rows( 'content_elemente' ) ) :
the_row();
?>
<section>
<?php if ( get_row_layout() == 'text-bild' ): ?>
<div class="content-element--text-bild">
<?php $reverse = get_sub_field( 'reihenfolge' ) == 't2b' ? '' : 'flex-row-reverse'; ?>
<div class="row no-gutters <?php echo $reverse; ?>">
<div class="col-12 col-md-6 bg-<?php the_sub_field( 'hintergrundfarbe' ); ?>">
<div class="text">
<h1>
<?php the_sub_field( 'title' ); ?>
</h1>
<p>
<?php the_sub_field( 'text' ); ?>
</p>
</div>
</div>
<div class="col-12 col-md-6">
<?php
$image = get_sub_field( 'bild' );
the_aid_picture_tag( $image['id'], 'bula-fullwidth', 'bula-fullwidth_2x', 'content-image' );
?>
</div>
</div>
</div>
<?php elseif ( get_row_layout() == 'fp-text' ): ?>
<div class="content-element--fp-text">
<?php the_sub_field( 'fp-text' ); ?>
</div>
<?php elseif ( get_row_layout() == 'header-1col' ):
if ( have_rows( 'header-1col' ) ):
while ( have_rows( 'header-1col' ) ) : the_row();
?>
<div class="header one-col bg-<?php the_sub_field( 'hintergrundfarbe' ); ?>">
<div class="infos">
<h1 class="post-title"><?php the_title(); ?></h1>
<div class="text-intro"><?php the_sub_field( 'text-header' ); ?></div>
</div>
</div>
<?php
endwhile;
endif;
?>
<?php elseif ( get_row_layout() == 'header-2col' ):
if ( have_rows( 'header-2col' ) ):
while ( have_rows( 'header-2col' ) ) : the_row();
?>
<div class="header bg-<?php the_sub_field( 'hintergrundfarbe' ); ?>">
<div class="infos">
<h1 class="post-title <?php the_sub_field( 'page-title-visibility' ); ?>">
<?php
if ( get_sub_field( 'page-title-visibility' ) == "on" ) {
the_title();
} ?> </h1>
<div class="text-intro"><?php the_sub_field( 'text-header' ); ?></div>
<?php if ( $link = get_sub_field( 'button' ) ): ?>
<a class="btn-black" href="<?php echo $link['url']; ?>" target="<?php echo $link['target']; ?>">
<?php echo $link['title']; ?>
</a>
<?php endif; ?>
</div>
<?php
if ( get_sub_field( 'hintergrundfarbe' ) == "yellow" ) {
$secondaryBgColor = "rgb(228, 81, 34)";
}
if ( get_sub_field( 'hintergrundfarbe' ) == "red" ) {
$secondaryBgColor = "rgb(73, 191, 252)";
}
if ( get_sub_field( 'hintergrundfarbe' ) == "blue" ) {
$secondaryBgColor = "rgb(254, 233, 52)";
}
?>
<div class="illustration" style="background: <?php echo $secondaryBgColor; ?>">
<?php if ( $image = get_sub_field( 'img-header' ) ) : ?>
<img src="<?php echo $image['url']; ?>">
<?php endif; ?>
</div>
</div>
<?php
endwhile;
endif;
?>
<?php elseif ( get_row_layout() == 'header-video' ):
if ( have_rows( 'header-video' ) ):
while ( have_rows( 'header-video' ) ) : the_row(); ?>
<div class="header header_video bg-<?php the_sub_field( 'hintergrundfarbe' ); ?>">
<div class="infos">
<h1 class="post-title <?php the_sub_field( 'page-title-visibility' ); ?>">
<?php
if ( get_sub_field( 'page-title-visibility' ) == "on" ) {
the_title();
} ?> </h1>
<div class="text-intro"><?php the_sub_field( 'text-header' ); ?></div>
<?php if ( $link = get_sub_field( 'button' ) ): ?>
<a class="btn-black" href="<?php echo $link['url']; ?>" target="<?php echo $link['target']; ?>">
<?php echo $link['title']; ?>
</a>
<?php endif; ?>
</div>
<div class="illustration">
<div class="embed-container">
<?php the_sub_field( 'video' ); ?>
</div>
</div>
</div>
<?php
endwhile; endif; ?>
<?php elseif ( get_row_layout() == 'farb-blocke' ): ?>
<div class="content-element--farb-bloecke">
<div class="row">
<div class="col-12">
<div class="intro-title">
<h2><?php the_sub_field( 'title' ); ?></h2>
</div>
</div>
</div>
<?php if ( have_rows( 'blocke' ) ): ?>
<div class="row masonry">
<?php while ( have_rows( 'blocke' ) ) : the_row(); ?>
<div class="col-12 col-md-6 farb-block-wrapper masonry-item">
<div class="farb-block bg-<?php the_sub_field( 'hintergrundfarbe' ); ?>">
<div class="title">
<?php if ( $image = get_sub_field( 'icon' ) ): ?>
<div class="icon">
<img src="<?php echo $image['url']; ?>">
</div>
<?php endif; ?>
<h3><?php the_sub_field( 'title' ); ?></h3>
</div>
<div class="farb-block-content">
<?php the_sub_field( 'text' ); ?>
</div>
</div>
</div>
<?php endwhile; ?>
</div>
<?php endif; ?>
</div>
<?php elseif ( get_row_layout() == 'sidebar-blocks' ): ?>
<div class="contact-bloc">
<?php if ( $image = get_sub_field( 'bild' ) ): ?>
<div class="contact-img">
<img src="<?php echo $image['sizes']['medium']; ?>">
</div>
<?php endif; ?>
<div class="contact-info">
<?php if ( get_sub_field( 'function' ) ): ?>
<h2>
<?php the_sub_field( 'function' ); ?>
</h2>
<?php endif; ?>
<?php if ( get_sub_field( 'name' ) ): ?>
<h1>
<?php the_sub_field( 'name' ); ?>
</h1>
<?php endif; ?>
<?php if ( get_sub_field( 'contact-info' ) ): ?>
<div class="personal-info">
<?php the_sub_field( 'contact-info' ); ?>
</div>
<?php endif; ?>
</div>
</div>
<div class="timeline">
<?php
if ( have_rows( 'timeline-items' ) ):
while ( have_rows( 'timeline-items' ) ) : the_row();
?>
<div class="event">
<?php if ( get_sub_field( 'date' ) ): ?>
<div class="event-date">
<?php the_sub_field( 'date' ); ?>
</div>
<?php endif; ?>
<?php if ( get_sub_field( 'text' ) ): ?>
<div class="event-name">
<?php the_sub_field( 'text' ); ?>
</div>
<?php endif; ?>
</div>
<?php
endwhile;
endif;
?>
</div>
<?php
if ( have_rows( 'person' ) ):
while ( have_rows( 'person' ) ): the_row();
the_sub_field( 'job' );
endwhile;
endif;
?>
<?php elseif ( get_row_layout() == 'text-spalten' ): ?>
<div class="content-element--text-spalten">
<div class="col-12 spalte-element bg-<?php the_sub_field( 'hintergrundfarbe' ); ?>">
<?php if ( get_sub_field( 'title' ) ): ?>
<div>
<h2><?php the_sub_field( 'title' ); ?></h2>
</div>
<?php endif; ?>
<div class="column-count-small-reset" style="column-count: <?php the_sub_field( 'anzahl_spalten' ); ?>">
<?php the_sub_field( 'text' ); ?>
</div>
<?php if ( $link = get_sub_field( 'button' ) ): ?>
<a class="btn-black" href="<?php echo $link['url']; ?>" target="<?php echo $link['target']; ?>">
<?php echo $link['title']; ?>
</a>
<?php endif; ?>
</div>
</div>
<?php if ( have_rows( 'blocke' ) ): ?>
<div class="row masonry">
<?php while ( have_rows( 'blocke' ) ) : the_row(); ?>
<div class="col-12 col-md-6 farb-block-wrapper masonry-item">
<div class="farb-block bg-<?php the_sub_field( 'hintergrundfarbe' ); ?>">
<div class="title">
<?php if ( $image = get_sub_field( 'icon' ) ): ?>
<div class="icon">
<img src="<?php echo $image['url']; ?>">
</div>
<?php endif; ?>
<h3><?php the_sub_field( 'title' ); ?></h3>
</div>
<div class="farb-block-content">
<?php the_sub_field( 'text' ); ?>
</div>
</div>
</div>
<?php endwhile; ?>
</div>
<?php endif; ?>
<?php elseif ( get_row_layout() == 'sidebar-blocks' ): ?>
<div class="content-element--sidebar-blocks">
<div class="contact">
<?php
if ( have_rows( 'elements' ) ):
while ( have_rows( 'elements' ) ) : the_row();
?>
<div class="contact-bloc">
<?php if ( $image = get_sub_field( 'bild' ) ): ?>
<div class="contact-img">
<img src="<?php echo $image['sizes']['medium']; ?>">
</div>
<?php endif; ?>
<div class="contact-info">
<?php if ( get_sub_field( 'function' ) ): ?>
<h2>
<?php the_sub_field( 'function' ); ?>
</h2>
<?php endif; ?>
<?php if ( get_sub_field( 'name' ) ): ?>
<h1>
<?php the_sub_field( 'name' ); ?>
</h1>
<?php endif; ?>
<?php if ( get_sub_field( 'contact-info' ) ): ?>
<div class="personal-info">
<?php the_sub_field( 'contact-info' ); ?>
</div>
<?php endif; ?>
</div>
</div>
<?php
endwhile;
endif;
?>
</div>
<div class="timeline">
<?php
if ( have_rows( 'timeline-items' ) ):
while ( have_rows( 'timeline-items' ) ) : the_row();
?>
<div class="event">
<?php if ( get_sub_field( 'date' ) ): ?>
<div class="event-date">
<?php the_sub_field( 'date' ); ?>
</div>
<?php endif; ?>
<?php if ( get_sub_field( 'text' ) ): ?>
<div class="event-name">
<?php the_sub_field( 'text' ); ?>
</div>
<?php endif; ?>
</div>
<?php
endwhile;
endif;
?>
</div>
</div>
<?php elseif ( get_row_layout() == 'gallery-blocks' ): ?>
<div class="content-element--gallery" data-loading="<?php _e( 'Bild wird geladen', 'bula21' ); ?>"
data-error="<?php _e( 'Es gab einen Fehler beim laden des Bildes.', 'bula21' ); ?>">
<div class="row">
<?php if ( have_rows( 'bilder' ) ):
while ( have_rows( 'bilder' ) ) : the_row(); ?>
<div class="col-12 col-md-4 col-lg-3">
<?php $image = get_sub_field( 'bild' );
the_aid_picture_tag( $image['id'], 'bula-gallery-preview', 'bula-gallery-preview_2x', 'gallery-item' );
?>
</div>
<?php endwhile;
endif; ?>
</div>
</div>
<?php endif; ?>
</section>
<?php endwhile; ?>
<?php endif; ?>
</div>
</div>
<?php endwhile; endif; ?>
<?php is_rest() ? : get_footer(); ?>